2209. Minimum White Tiles After Covering With Carpets
IntuitionApproachComplexity
Time complexity:

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

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

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

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

# Code
```python3 []
class Solution:
    def minimumWhiteTiles(self, tiles, maxCuts, length):

        from functools import lru_cache

        @lru_cache(None)
        def helper(pos, cutsLeft):
            if pos <= 0: 
                return 0
            return min(int(tiles[pos - 1]) + helper(pos - 1, cutsLeft), 
                       helper(pos - length, cutsLeft - 1) if cutsLeft else float('inf'))
        
        return helper(len(tiles), maxCuts)
```
['Python3']