2138. Divide a String Into Groups of Size k, Time complexity: O(N), Space complexity: O(N)
IntuitionApproachComplexity
Time complexity: O(N)

Space complexity: O(N)
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity: O(N)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(N)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def divideString(self, s, k, fill):
        len_s = len(s)

        ret_val = []

        start_index = 0
        end_pos = start_index + k
        while (end_pos <= len_s):
            ret_val.append(s[start_index:end_pos])
            
            start_index += k
            end_pos += k
        
        if (end_pos - len_s < k):
            ret_val.append(s[start_index:end_pos] + (end_pos-len_s) * fill)
        
        return ret_val
```
['Python3']