[LeetCode] 189. Rotate Array
无敌的切片他又来了。
class Solution:
def rotate(self, nums: List[int], k: int) -> None:
"""
Do not return anything, modify nums in-place instead.
"""
#0
if k ==0:
pass
#else
lenn = len(nums)
k = k % lenn
nums[:] =nums[lenn -k:] + nums[:lenn -k]