Write a method leftRotate
which rotates the array n
times. Each rotation shifts all elements to the left and places the first element at the end.
leftRotate(int[] array, int n)
//write pseudocode
array = [1,2,3,4,5]
n = 1
result = [2,3,4,5,1]
array = [1,2,3,4,5]
n = 3
result = ?
array = [1,2,3,4,5]
n = 5
result = ?