Easy approach || c++
Approach\nhere i is of loop which starts form (0,1,2...) k is the value how many times you want to rotate and n is the size of first vector ,and after that new 
# Approach\nhere i is of loop which starts form (0,1,2...) k is the value how many times you want to rotate and n is the size of first vector ,and after that new indexes will be generated in our temp vector and we have to put values of nums vector at new indexes . . . \nlike for first  arr[1,2,3,4,5,6,7]  and k=3     so ,\ntemp[0 + 3 % 7]=nums[i]\ntemp[3 % 7]=nums[i]\ntemp[3] = nums[i]\n[_ , _ , _ , 1 , _ ,_ , _ ]\nfor next ,\ntemp[1 + 3 % 7]=nums[i]\ntemp[4 % 7]=nums[i]\ntemp[4] = nums[i]\n[_ , _ , _ , 1 , 2 ,_ , _ ]   and so on \ni hope you understand ..\n# Code\n```\nclass Solution {\npublic:\n    void rotate(vector<int>& nums, int k) {\n        int n=nums.size();\n        vector<int> temp(nums.size());\n        for(int i=0;i<n;i++){\n            temp[(i+k)%n]=nums[i];\n        }\n        nums=temp;\n    }\n};\n```\n![upvote 1.jpeg](https://assets.leetcode.com/users/images/565d5fa5-1370-44d9-a6b6-0cf06d575aae_1681731352.2608747.jpeg)\n
['C++']