其他分享
首页 > 其他分享> > leetcode-easy-array-189 Rotate Array

leetcode-easy-array-189 Rotate Array

作者:互联网

mycode  75.59%

class Solution(object):
    def rotate(self, nums, k):
        """
        :type nums: List[int]
        :type k: int
        :rtype: None Do not return anything, modify nums in-place instead.
        """
        k = k%(len(nums))
        nums[:] = nums[-k:] + nums[:-k]

 

标签:Do,Rotate,k%,nums,int,easy,array,type,leetcode
来源: https://www.cnblogs.com/rosyYY/p/10984931.html