4 lines C++ Solution
\nstring reverseStr(string s, int k) {\n        for(int i=0; i<s.length();i+=2*k)\n            if(i+k<=s.length()) reverse(s.begin()+i,s.begin()+i+k);\n        
  ````\nstring reverseStr(string s, int k) {\n        for(int i=0; i<s.length();i+=2*k)\n            if(i+k<=s.length()) reverse(s.begin()+i,s.begin()+i+k);\n            else reverse(s.begin()+i,s.end());\n        return s;\n    }\n````
[]