Python solution, Super simple, easy to understand [Common mistakes explained!]
1. Solution\n\n\n    def rotate(self, nums, k):\n        k = k % len(nums)                 #take care of the case where k >= len(nums)  \n        nums[:] = nums
**1. Solution**\n\n```\n    def rotate(self, nums, k):\n        k = k % len(nums)                 #take care of the case where k >= len(nums)  \n        nums[:] = nums[-k:] + nums[:-k] \n```\n\n\n\n**2. Remarks**\n\n* We use  `k % len(nums)` to take care of the case where the input `k` is larger than the length of `nums` list.\n* There\'s no return value since we modified the list in-place using  `nums[:] = ...` .\n\n\n**3. Common confusion** \n* ***Why ` return nums[-k:] + nums[:-k] ` doesn\'t work?***\n\n     Well, it should work when you run it locally (not on Leetcode). Because there\'s an extra constraint added in the follow-up questions which requires in-place list modification. And this is clearly not an in-place modification, so it won\'t pass the Leetcode tests.\n\t \n\t \n****Please upvote if you find it useful, and welcome to any further discussion!***
['Python', 'Python3']