Beats 100% 3 Line Solution ||  Fully MOST Optimised Code
Intuition\n Describe your first thoughts on how to solve this problem. \nStart!!\n\n# Approach\n Describe your approach to solving the problem. \nExample:-12345
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nStart!!\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nExample:-1234567 ,k=3\n1.first reverse the numbers form index 0 to n-k;\n->4321 567\n2.reverse the k elements from the last \n->4321 765\n3.now reverse the whole nums;\n->5671234 Done Answer is here !!!!\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(N)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n# Code\n```\nclass Solution {\npublic:\n    void rotate(vector<int>& nums, int k) {\n        // vector<int>temp;\n        // int len=nums.size();\n        // int j=0;\n        // k=k%len;\n        // for(int i=0;i<abs(len-k);i++)\n        // {\n        //     //1,2,3,4\n        //     cout<<nums[i]<<" ";\n        //     temp.push_back(nums[i]);\n        // }\n        // cout<<endl;\n        // for(int i=abs(len-k);i<len;i++)\n        // {\n        //     //5,6,7\n\n        //     cout<<nums[i]<<endl;\n        //     nums[abs(i-abs(len-k))]=nums[i];\n        // }\n        // for(int i=k;i<len;i++)\n        // {\n        //     nums[i]=temp[j];\n        //     j++;\n        // }\n        \n        k=k%nums.size();\n        reverse(nums.begin(),nums.begin()+(nums.size()-k));\n\n        reverse(nums.begin()+(nums.size()-k),nums.end());\n    \n        reverse(nums.begin(),nums.end());\n            \n\n        \n        \n\n        \n        \n    }\n};\n```\n**Important -> Search *yashsiwach* in solutions of any question to get my image Solution thanks!\uD83D\uDCAF**\n# Connect on LinkedIn ,link in Leetcode Profile !\n**Upvote if it Helped !\uD83D\uDD25**\n\n
['C++']