C++. O(n) time. O(1) space. 0 ms, faster than 100.00%. 4 lines. amazing & cool solution!!!!
```\nclass Solution {\npublic:\n    void rotate(vector& nums, int k) {\n        k = k % nums.size();\n        reverse(nums.begin(), nums.end());\n        revers
```\nclass Solution {\npublic:\n    void rotate(vector<int>& nums, int k) {\n        k = k % nums.size();\n        reverse(nums.begin(), nums.end());\n        reverse(nums.begin(), nums.begin() + k);\n        reverse(nums.begin() + k, nums.end());\n    }\n};
['C', 'C++']