Python Solution Not accepted by online Judge


  • -2
    I

    My Python code is -

    def rotate(self, nums, k):
        nums = nums[::-1][:k%len(nums)][::-1] + nums[::-1][k%len(nums):][::-1]
        print nums
    

    When I submitted my solution

    Your stdout
    [5, 6, 7, 1, 2, 3, 4]
    Your answer
    [1,2,3,4,5,6,7]

    How can It is possible ? . It seems any change I made in this function is not reflected in the
    my answer.


Log in to reply
 

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