C++ | Easiest solution
\n\n# Approach\nBrute force or iterative approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time complexity:O(n)\n Add your time comp
\n\n# Approach\nBrute force or iterative approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    string reverseStr(string s, int k) {\n        for(int i = 0 ; i < s.size() ; i=i+(2*k)){\n            int st = i;\n            int e = i+k-1;\n            if(e>=s.size()){\n                e = s.size()-1;\n            }\n            while(st<e){\n                swap(s[st++],s[e--]);\n            }\n         }\n        return s;\n       \n    }\n};\n```
['Iterator', 'C++']