lee215's PYTHON solution with comments
Copying lee215\'s solution\n# https://leetcode.com/u/lee215/\n\n# Code\npython3 []\n\n# Copying lee215\'s solution\n# https://leetcode.com/u/lee215/\n\nimport f
# Copying lee215\'s solution\n# https://leetcode.com/u/lee215/\n\n# Code\n```python3 []\n\n# Copying lee215\'s solution\n# https://leetcode.com/u/lee215/\n\nimport functools\n\nclass Solution:\n\n    def minimumWhiteTiles(self, tiles, remaining_carpets, carpet_length):\n\n        @lru_cache(None)\n        def _layCarpet(next_tile_index, remaining_carpets):\n            if next_tile_index <= 0:\n                return 0\n\n            skip_tile_choice = (\n                int(tiles[next_tile_index - 1])\n                +\n                _layCarpet(\n                    next_tile_index - 1,\n                    remaining_carpets\n                    )\n                )\n            if remaining_carpets:\n                lay_tile_choice = _layCarpet(next_tile_index - carpet_length, remaining_carpets - 1)\n            else:\n                lay_tile_choice = 1000  # Max\n            \n            return min(skip_tile_choice, lay_tile_choice)\n\n        last_tile_index = len(tiles)    \n        return _layCarpet(last_tile_index, remaining_carpets) \n```
['Python3']