Java✅1ms,100% faster🔥,99% less memory usage
If you really found my solution helpful please upvote it, as it motivates me to post such kind of codes and help the coding community, if you have some queries 
**If you really found my solution helpful please upvote it, as it motivates me to post such kind of codes and help the coding community, if you have some queries or some improvements please feel free to comment and share your views.**\n```\nclass Solution {\n    public String reverseStr(String s, int k) {\n        char[] str = s.toCharArray();\n        int n = str.length;\n        for(int i = 0 ; i <= n-1; i += 2*k){\n            if(i+k-1 <= n-1){\n                reverseK(i,i+k-1,str);\n            }else{\n\t\t\t\t//for fewer than k characters left (edge case)\n                reverseK(i,n-1,str);\n            }\n        }\n        String ans = new String(str);\n        return ans;\n    }\n    public void reverseK(int i, int j, char[] str){\n        while(i < j){\n            char temp = str[i];\n            str[i] = str[j];\n            str[j] = temp;\n            i++;\n            j--;\n        }\n    }\n}\n```\n**Happy Coding**
['Java']