2-liner python 🐍  solution beats 99.8% time
\nclass Solution:\n    def rotate(self, nums: List[int], k: int) -> None:\n        """\n        Do not return anything, modify nums in-place instead.\n        "
```\nclass Solution:\n    def rotate(self, nums: List[int], k: int) -> None:\n        """\n        Do not return anything, modify nums in-place instead.\n        """\n        \n        k=k%len(nums)\n        nums[:]=nums[-k:]+nums[:-k]\n```\nHowever, its considered O(n) space since nums[:] is equivalent to creating a new array
['Python', 'Python3']