Best Java Solution || Beats 100%
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    static void reverse(char[] arr, int i, int j){\n       while(i<j){\n        char temp=arr[i];\n        arr[i]=arr[j];\n        arr[j]=temp;\n        i++;\n        j--;\n    }\n    }\n    public String reverseStr(String s, int k) {\n      int i=0; int n=s.length();\n      char[] arr=s.toCharArray();\n      while(i<n){\n          int j=Math.min(i+k-1,n-1);\n          reverse(arr,i,j);\n          i=i+2*k;\n      }\n      String str=new String(arr);\n\n      return str;\n    }\n}\n```
['Java']