[Python] Simple solution | 85% faster | O(N) Time | 99% Space efficient
Understanding:\nSlice the strings in length of k, append them to a list. Check the length of the last item in the list, if its length is less than k then add th
Understanding:\nSlice the strings in length of k, append them to a list. Check the length of the last item in the list, if its length is less than k then add the fill letter (length of last item - k) times\n\nAlgorithm:\n- Loop: from index 0 till index less than length of string\n- Append s[i:i+k] to list\n- Increment index by k\n- End loop\n- If length of last element in list is less than k then\n- Last element = last element + fill*(k-len(last element))\n- Return list\n\nPython code :\n```\nclass Solution:\n    def divideString(self, s: str, k: int, fill: str) -> List[str]:\n        l, i, N = [], 0, len(s)\n        while i<N:\n            l.append(s[i:i+k])\n            i += k\n        last = l[-1]\n        if(len(last)<k):\n            l[-1] += fill*(k-len(last))\n        return l\n```
['String', 'Python']