C++ || O(1) Space Follow Up || Reverse Approach || 3 Solution
This solution can be done in the following approaches:\n1. Creating an array and add last k elements firast then add 1 to n-k elements in the array.\n2. We can 
This solution can be done in the following approaches:\n1. Creating an array and add last k elements firast then add 1 to n-k elements in the array.\n2. We can store last element of array in a variable and will rotate array by 1. Repeat this k times.\n3.  Reversing the array multiple times. (Code is below)\n\n```\nclass Solution {\npublic:\n    void rotate(vector<int>& nums, int k) {\n        \n        int n=k%nums.size(); //if k is greater then size\n        \n        reverse(nums.begin(),nums.end()); //reverse full array\n        \n        reverse(nums.begin(),nums.begin()+n);   //reverse first k elements\n        \n        reverse(nums.begin()+n,nums.end());     // reverse remaining elements\n        \n    }\n};\n```\nPlease **UpVote** if you liked my solution.\nDon\'t forget to check my other solution: https://github.com/tarunsahnan/LeetCode-Solutions
['Array', 'C']