| [ Web Proxy ] |
| Viewing: https://raw.githubusercontent.com/codec-akash/DSA-PS-Java-Programs/master/Rotate_Array.java | [Back] [Original] |
//https://leetcode.com/problems/rotate-array/
class Solution {
public void rotate(int[] nums, int k) {
for(int i=0;i=0){
nums[j+1] = nums[j];
j--;
}
nums[0] = temp;
}
}
}
| Web Proxy Viewer | New URL | Original Page |