Simple python code to Solve!


  • -2
    Y

    def rotate(self, nums, k):enter code here
    lenth=len(nums)enter code here
    nums[:]=nums[lenth-k:lenth]+nums[0:lenth-k]enter code here


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.