1 line in C++ || Optimized Solution || Using Inbuilt Function
Intuition\n\n\n\n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time complexity: O(N)\n Add your time complexity here, e.g. O
# Intuition\n\n\n\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    void rotate(vector<int>& nums, int k) {\n    k= k%nums.size();\n    std::rotate(nums.begin(), nums.begin()+nums.size()-k, nums.end());  \n    }\n};\n```\n<!-- Describe your first thoughts on how to solve this problem. -->\n![upvote1.gif](https://assets.leetcode.com/users/images/73a3f1a5-c0ba-4c88-9276-144642d7fc29_1690519094.3517249.gif)
['C++']