Python top-down DP | Almost one-liner
\nclass Solution:\n    def minimumWhiteTiles(self, nums: str, numCarpets: int, carpetLen: int) -> int:\n        @cache\n        def dfs(i, rem):\n            re
```\nclass Solution:\n    def minimumWhiteTiles(self, nums: str, numCarpets: int, carpetLen: int) -> int:\n        @cache\n        def dfs(i, rem):\n            return 0 if i >= len(nums) else min((1 if nums[i]==\'1\' else 0) + dfs(i+1, rem), dfs(i+carpetLen, rem-1) if rem and nums[i]==\'1\' else float(\'inf\'))\n        \n        return dfs(0, numCarpets)\n```
['Dynamic Programming', 'Memoization', 'Python']