✔️ [Python3] IN-PLACE (งツ)ว, Exaplained
UPVOTE if you like (\uD83C\uDF38\u25E0\u203F\u25E0), If you have any question, feel free to ask.\n\nThe idea is to reverse the given list, and then reverse elem
**UPVOTE if you like (\uD83C\uDF38\u25E0\u203F\u25E0), If you have any question, feel free to ask.**\n\nThe idea is to reverse the given list, and then reverse elements in the range `0..k` and in the range `k..L`. For example `nums = [1,2,3,4,5,6,7]`, `k = 3`:\n\n1. Reverse: `nums` = [**7,6,5,4,3,2,1**] \n2. Reverse in the range `0..k`:  `nums` = [**5,6,7**,4,3,2,1]\n3. Reverse in the range `k..L`:  `nums` = [5,6,7,**1,2,3,4**]\n\nNotice that `k` can be greater than `L` (length of the `nums`) because `k` is number of rotattion steps. If `k` is equal to `L`, elements do full rotation and `nums` is not changed. So for this case we can recalculate `k` as `k%L`.\n\nTime: **O(n)** - for reverse and swaps\nSpace: **O(1)** - in-place\n\nRuntime: 220 ms, faster than **81.00%** of Python3 online submissions for Rotate Array.\nMemory Usage: 25.4 MB, less than **96.40%** of Python3 online submissions for Rotate Array.\n\n```\ndef rotate(self, nums: List[int], k: int) -> None:\n\tL = len(nums)\n\tif L == k: return\n\n\tk = k%L # the case when k > L\n\tnums.reverse()\n\n\tfor i in range(k//2):\n\t\tnums[i], nums[k-1-i] = nums[k-1-i], nums[i]\n\n\tfor i in range(k, (L+k)//2):\n\t\tnums[i], nums[L-1-i+k] = nums[L-1-i+k], nums[i]\n```\n\n**UPVOTE if you like (\uD83C\uDF38\u25E0\u203F\u25E0), If you have any question, feel free to ask.**
['Python3']