Simplest C++ solution with explanation
Simple using basic logic and condition\n\n\nclass Solution {\npublic:\n    string reverseStr(string s, int k) {\n        \n        // size_t is unsigned int\n  
**Simple using basic logic and condition**\n\n```\nclass Solution {\npublic:\n    string reverseStr(string s, int k) {\n        \n        // size_t is unsigned int\n        //i+=k*2 here we incresase i as per given condition\n        \n        for( size_t i=0;i<s.size();i+=k*2 ){\n            \n            // if length is shorter then perform operation\n            // otherwise change upto i\n            if( i+k<=s.length() ){\n                reverse(s.begin()+i,s.begin()+i+k);\n            }else{\n                reverse(s.begin()+i,s.end());\n            }\n        }\n        \n        return s;\n    }\n};\n```\n\n```\nIf you like this please upvote and thank you\n\nhappy coding feel free to ask in comments\n```
['C', 'C++']