Easy Solution with Explanation without using Extra space
\n# Approach\n Describe your approach to solving the problem. \nThe approach is here to use circular rotation i.e, here in \n##### Example 1:\nInput: nums = [1,
\n# Approach\n<!-- Describe your approach to solving the problem. -->\nThe approach is here to use circular rotation i.e, here in \n##### Example 1:\nInput: nums = [1,2], k = 3\n Output: [2,1]\n\nif the value of k is greater than the size of the array, then our array can go out of bounds, to solve that and rotate the array under given condition we are using circular rotation. i.e, **k= k% nums.length**\n\nHere in E:g the k=3, now if k%n = 3%2 ==> 1, so the value of rotation becomes 1.\n\n### To Arrange the elements in place\n\n1) First we have to reverse the whole array using two pointers technique.\n2) Now after the array is reversed, now we have to reverse the elements before the occurence of k, i.e, **(0,k-1)**\n\n**Note:** [Here we have  here we subtracted 1 from k **(0,k-1)**, because we are using 0-indexed array].\n\n3) Now we have to reverse the elements after the occurence of k(rotation), i.e, \n**(k,nums.length-1)**\n\nNow, the array is arranged without using extra space\n\n\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 {\n    public void rotate(int[] nums, int k) {\n        k %= nums.length;\n        rotate(nums,0,nums.length-1);\n        rotate(nums,0,k-1);\n        rotate(nums,k,nums.length-1);\n    }\n    private void rotate(int[] nums, int low, int high){\n        while(low<high){\n            int temp = nums[low];\n            nums[low] = nums[high];\n            nums[high] = temp;\n            low++;\n            high--;\n        }\n    }\n}\n```\n## Upvote me if you like the approach and explanation. This helps me to bring you more solutions like that............
['Array', 'Math', 'Two Pointers', 'Java']