3.旋转数组(Python)

思路 利用数组切片的思想 参考代码 class Solution: def rotate(self, nums, k): """ :type nums: List[int] :type k: int :rtype: void Do not return anything, modify nums in-place instead. """ mod = k%len(nums) #移动位数对数组长度取
相关文章
相关标签/搜索