Go solution: Time O(n) Space O(1)
\nfunc rotate(nums []int, k int) {\n    n := len(nums)\n    k %= n\n    reverse(nums, 0, n - 1)\n    reverse(nums, 0, k - 1)\n    reverse(nums, k, n - 1)\n}\n\n
```\nfunc rotate(nums []int, k int) {\n    n := len(nums)\n    k %= n\n    reverse(nums, 0, n - 1)\n    reverse(nums, 0, k - 1)\n    reverse(nums, k, n - 1)\n}\n\nfunc reverse(nums []int, start int, end int) {\n    for start < end {\n        nums[start], nums[end] = nums[end], nums[start]\n        start++\n        end--\n    }\n}\n```
['Go']