records/08-13/asda111.py
def rotate(self, nums, k: int) -> None:
        """
        Do not return anything, modify nums in-place instead.
        """
        k %= len(nums)
        if k <= len(nums):
            res = []
            while k:
                val = nums.pop()
                res.append(val)
                k -= 1

            for val in res:
                nums.insert(0, val)
        else:
            nums.reverse()

        Do not return anything, modify nums in-place instead.
        
Do not return anything, modify nums in-place instead.
Do not return anything modify nums in - place instead .
def rotate(self, nums, k: int) -> None:
        k %= len(nums)
        if k <= len(nums):
            res = []
            while k:
                val = nums.pop()
                res.append(val)
                k -= 1
            for val in res:
                nums.insert(0, val)
        else:
            nums.reverse()
def rotate ( self , nums , k : int ) -> None : k %= len ( nums ) if k <= len ( nums ) : res = [ ] while k : val = nums . pop ( ) res . append ( val ) k -= 1 for val in res : nums . insert ( 0 , val ) else : nums . reverse ( )
Do not return anything, modify nums in-place instead.
Do not return anything modify nums in - place instead .
"""
        Do not return anything, modify nums in-place instead.
        """
self
nums
k
int