You are viewing a single comment's thread. Return to all comments →
You didn't actually rotated the array, printing the required answer is not the solution. The rotated array might be of some use later in the actual program and the problem is designed to practice the array rotation. Hope you try to understand.
I understand that. But in this question i was required just to print the rotated form so i did the same. If i was to use the array later on, it wouldn't have been tough to declare a new array and start storing in it using a counter variable. So i kept it simple here just to pass all the test cases :)
"A left rotation operation on an array of size n shifts each of the array's elements d unit to the left."
That opening problem statement alone means that you need to shift an existing array; not just print the array in the shifted order.