2138. Divide a String Into Groups of Size k

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 2138

class Solution:
    def divideString(self, s: str, k: int, fill: str) -> List[str]:
        return [s[i : i + k].ljust(k, fill) for i in range(0, len(s), k)]