Easy to read Java solution
I really don't like those something little line solutions as they are incredibly hard to read. Below is my solution.\n\n    public void rotate(int[] nums, int k
I really don't like those _*something little*_ line solutions as they are incredibly hard to read. Below is my solution.\n\n    public void rotate(int[] nums, int k) {\n        k %= nums.length;\n        reverse(nums, 0, nums.length - 1);\n        reverse(nums, 0, k - 1);\n        reverse(nums, k, nums.length - 1);\n    }\n    \n    public void reverse(int[] nums, int start, int end) {\n        while (start < end) {\n            int temp = nums[start];\n            nums[start] = nums[end];\n            nums[end] = temp;\n            start++;\n            end--;\n        }\n    }
['Java']