...

/

Example 65: Rotate an Array

Example 65: Rotate an Array

Learn how to rotate the contents of an array.

Problem

Write a function that rotates left the contents of a 1D array of integers by the desired number of places.

Example

Suppose an array named arr contains the following elements:

arr[] = {1, 2, 3, 4, 5, ...