python 2 pointer solution - easy for beginners
Code\n\nclass Solution:\n    def reverseStr(self, s: str, k: int) -> str:\n        temp = []\n        first = 0\n        last = k-1                 \n        wh
# Code\n```\nclass Solution:\n    def reverseStr(self, s: str, k: int) -> str:\n        temp = []\n        first = 0\n        last = k-1                 \n        while (first <= len(s)-1):     \n            if last > len(s)-1:\n                last = len(s) - 1\n            while(last >= first): \n                temp.append(s[last])  \n                last = last - 1\n            first = first + k                 \n            last = first + (k-1)\n            while(last >= first):\n                if first > len(s)-1:\n                    break\n                temp.append(s[first])  \n                first = first + 1                \n            last = first + (k-1)       \n        return \'\'.join(temp)\n            \n\n```
['Python3']