You are viewing a single comment's thread. Return to all comments →
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.