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]

 

相关文章:

  • 2021-08-14
  • 2021-06-04
  • 2021-12-14
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-01
  • 2021-11-02
  • 2021-11-12
  • 2021-06-02
  • 2021-10-09
  • 2021-08-13
  • 2021-12-23
相关资源
相似解决方案