class Solution:
def rotate(self, nums: List[int], k: int) -> None:
"""
Do not return anything, modify nums in-place instead.
"""
n = len(nums) #原长度
for _ in range(k): #右边填充k位辅助
nums.append(sys.maxsize)
for i in range(len(nums)-1, k-1, -1): #整体向右平移k位
nums[i] = nums[i-k]
for j in range(k-1, -1, -1): #超出n的部分放回左边
nums[j] = nums[j+n]
nums.pop() #删除辅助位