Simple Solution | C++
\nTime: O(n)  Space: O(1)\n\nclass Solution {\npublic:\n    string reverseStr(string s, int k) {\n        int n=size(s);\n        for(int i=0;i<n;i=i+2*k){\n   
```\nTime: O(n)  Space: O(1)\n\nclass Solution {\npublic:\n    string reverseStr(string s, int k) {\n        int n=size(s);\n        for(int i=0;i<n;i=i+2*k){\n            int j=i+k-1,k=i;\n            if(j>=n) \n                j=n-1;\n            while(k<(j)){\n                swap(s[k],s[j]);\n                k++,j--;\n            }\n        }\n        return s;\n    }\n};\n```
['C', 'C++']