[Python3] simple bottom-up DP solution
python\nclass Solution:\n    def minimumWhiteTiles(self, floor: str, numCarpets: int, carpetLen: int) -> int:\n        n = len(floor)\n        dp = [[0]*(numCar
```python\nclass Solution:\n    def minimumWhiteTiles(self, floor: str, numCarpets: int, carpetLen: int) -> int:\n        n = len(floor)\n        dp = [[0]*(numCarpets+1) for _ in range(n+1)]\n        for i in range(1, n+1):\n            dp[i][0] = dp[i-1][0] + (floor[i-1] == \'1\')\n        \n        for k in range(1, numCarpets+1):\n            for i in range(1, n+1):\n                dp[i][k] = min(dp[max(0, i-carpetLen)][k-1], dp[i-1][k]+(floor[i-1] == \'1\'))\n\n        return dp[-1][numCarpets]\n```\n
['Dynamic Programming', 'Python']