There was an error while loading. Please reload this page.
1 parent 938e52b commit d360c4bCopy full SHA for d360c4b
LeetCode/0189_Rotate_Array.py
@@ -0,0 +1,6 @@
1
+class Solution:
2
+ def rotate(self, nums: List[int], k: int) -> None:
3
+ for i in range(k):
4
+ lastValue = nums.pop()
5
+ nums.insert(0, lastValue)
6
+ return nums
0 commit comments