Hi,
My C# solution using O(1) extra space to this question https://leetcode.com/problems/rotate-array/ passes 35/35 test cases, but I still get a TLE error.
I'm not sure what's causing the error.
Looking at my solution can anyone tell me what to work on?
public void Rotate(int[] nums, int k) {
while(k>0){
int last = nums[nums.Length-1];
for(int i = nums.Length-1; i>0; i--)
nums[i]=nums[i-1];
nums[0]=last;
k--;
}
}
```
Thanks!