In this post, we will solve the Left Rotation HackerRank Solution. This problem (Left Rotation) is a part of the HackerRank Problem Solving series.
the array that many steps left and return the result.
d = 2
arr = [1, 2, 3, 4, 5]
After 2 rotations,arr = [1, 2, 3, 4, 5] .
Complete the rotateLeft function in the editor below.
rotateLeft has the following parameters:
- int d: the amount to rotate by
- int arr[n]: the array to rotate
- int[n]: the rotated array