PYTHON SOLUTION - EASY || EXPLAINED LINE BY LINE✔
\nclass Solution:\n    def reverseStr(self, s: str, k: int) -> str:\n        #if length of the s is less than the k then all letters will get reversed\n        
```\nclass Solution:\n    def reverseStr(self, s: str, k: int) -> str:\n        #if length of the s is less than the k then all letters will get reversed\n        if len(s)<k:\n            return s[::-1]\n        \n        i=0 #the left pointer which will everytime will be the first character of the 2k length substring\n        j=0 #the right pointer which will check if the 2k length substring present in the s or not\n        st="" #the result string\n        \n        #the loop will work if the k length substring will be present in the string s\n        while i<len(s) and i+k-1<len(s):\n            #joining the k length substring after reversing\n            st=st+"".join(reversed(s[i:i+k]))\n            #pointer j (right side) will get updated to the 2k characters ahead in the s\n            j+=2*k\n            #if the pointer j gets equal or bigger to the indeces of string then end the process\n            #as it may not have k total length characters in the s anymore (must be less than k)\n            if j>=len(s):\n                break \n            #otherwise the substring which is being skipped after every 2k elements need to be appended\n            #to the string st as it is (should not reversed)\n            st=st+s[i+k:j]\n            #and then the i will also get ahead of 2k elements\n            i=j \n            \n        #if fewer elements are still remaining in the s (which is less than the next 2k charcters)\n        #means the string would have finished before the next i can go to the next 2k character\n        #in short neither i is present nor j in s (if r!=0)\n        r=len(s)-len(st)\n        \n        #this is the condition if the i would have reached to the first character of the 2k length \n        #substring but not having the total 2k length of the substring , means i present under the\n        # length of s but j would be greater than the length of s \n        #in short i is present but not j in s , so from ith index remaining characters will get reversed\n        \n        if len(s)-i<k:\n            return st+"".join(reversed(s[i:i+k]))\n        \n        #if r not 0 then all the characters will be appended to the st as it is\n        elif r:\n            st=st+s[len(s)-r:]\n        \n        return st      \n```\n**PLEASE UPVOTE IF YOU FOUND THE SOLUTION HELPFUL\nTHANKS !!**
['Python']