Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.

Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

class Solution { public: void rotate(int nums[], int n, int k) { if(k>0&&n>0){ int temp=0; temp=nums[(n-k)%n]; for(int i=2;i<=n;i++) { nums[(i-1)(n-k)%n]=nums[i(n-k)%n]; } nums[0]=temp; } } };

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.