c++ | basic | easy-understanding
\nclass Solution {\npublic:\n    string reverseStr(string s, int k) {\n        for(int i=0;i<s.size();){\n            if(i+k<s.size())reverse(s.begin()+i,s.begi
```\nclass Solution {\npublic:\n    string reverseStr(string s, int k) {\n        for(int i=0;i<s.size();){\n            if(i+k<s.size())reverse(s.begin()+i,s.begin()+i+k);\n            else reverse(s.begin()+i,s.end());\n            i+=2*k;\n        }\n        return s;\n    }\n};\n```
['C']