96% Faster Solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/*\nclass Solution {\n\n    public int minimumWhiteTiles(String floor, int numCarpets, int carpetLen) {\n        int n = floor.length(), dp[][] = new int[n + 1][numCarpets + 1];\n\n        for (int i = 1; i <= n; i++) {\n            for (int k = 0; k <= numCarpets; k++) {\n                int jump = dp[i - 1][k] + floor.charAt(i - 1) - \'0\';\n                int cover = k > 0 ? dp[Math.max(i - carpetLen, 0)][k - 1] : 1000;\n                dp[i][k] = Math.min(cover, jump);\n            }\n        }\n        return dp[n][numCarpets];\n    }\n}\n*/\nclass Solution {\n    public int minimumWhiteTiles(String floor, int numCarpets, int carpetLen) {\n        int n = floor.length();\n        if (numCarpets * carpetLen >= n) return 0;\n        int[] dp = new int[n + 1];\n        for (int i = n - 1; i >= 0; i--) {\n            dp[i] = floor.charAt(i) == \'1\' ? dp[i + 1] + 1 : dp[i + 1];\n        }\n        int[] temp = new int[n + 1];\n        for (int i = 1; i <= numCarpets; i++) {\n            temp[n - i * carpetLen] = 0;\n            for (int j = n - i * carpetLen - 1; j >= (numCarpets - i) * carpetLen; j--)\n                temp[j] = Math.min(dp[j + carpetLen], temp[j + 1] + (floor.charAt(j) == \'1\' ? 1 : 0));\n            int[] temp2 = temp;\n            temp = dp;\n            dp = temp2;\n        }\n        return dp[0];\n    }\n}\n```
['Java']