Simple C solution beats 100% without using two pointers approach.
Intuition\n Describe your first thoughts on how to solve this problem. My approach to solve this problem is that find the length of the string.\n- First k chara
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->My approach to solve this problem is that find the length of the string.\n- First k characters should be reversed, next k characters should be left as it is and then again next k characters should be reversed, this should be continued until the end.\n- If we have few characters left out at the last which is less than k, we need to handle them seperately.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nvoid reverse_fn(char* s, int ind1, int ind2)\n{\n    for (int i = 0; i < ((ind2 - ind1 + 1)/2); i++) {\n        char temp = s[ind1+i];\n        s[ind1+i] = s[ind2-i];\n        s[ind2-i] = temp;\n    } \n}\n\nchar* reverseStr(char* s, int k) {\n    int n, l, i;\n\n    l = strlen(s);\n    n = l / k;\n\n    for(i = 1; i <= n; i++) {\n        if(i % 2 == 1) {\n            reverse_fn(s, (i-1)*k, i*k-1);\n        }\n    }\n    if(l % k != 0) {\n        if(n % 2 == 0) {\n            reverse_fn(s, n*k, ((n*k) + (l%k)-1));\n        }\n    }\n    return s;\n}\n```
['C']