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]
原文地址:https://www.cnblogs.com/rosyYY/p/10984931.html