Easy intuitive Solution Using Recursion and Memoization||Tabulation
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```\nclass Solution {\npublic:\n   int solve(string s,int numCar,int carLen,int i,vector<vector<int>>&dp)\n   {\n      \n         if(i>=s.size())\n         return(0);\n       if(dp[i][numCar]!=-1)\n       return(dp[i][numCar]);\n         int take=1000,notake=1000,notake1=1000;\n         if(s[i]==\'1\')\n         {\n           if(numCar>0)\n           take=solve(s,numCar-1,carLen,i+carLen,dp);\n           notake=solve(s,numCar,carLen,i+1,dp)+1;\n         }\n         else\n         notake1=solve(s,numCar,carLen,i+1,dp);\n         return(dp[i][numCar]=min(take,min(notake,notake1)));\n   }\n   int solveTab(string s,int numCar,int carLen,vector<vector<int>>dp)\n   {\n         for(int i=s.size()-1;i>=0;i--)\n         {\n           for(int j=0;j<=numCar;j++)\n           {\n                int take=1000,notake=1000,notake1=1000;\n         if(s[i]==\'1\')\n         {\n           if(j>0)\n           {\n             if((i+carLen)>=s.size())\n             take=0;\n             else\n           take=dp[i+carLen][j-1];\n           }\n           notake=dp[i+1][j]+1;\n         }\n         else\n         notake1=dp[i+1][j];\n         dp[i][j]=min(take,min(notake,notake1));\n           }\n         }\n         return(dp[0][numCar]);\n   }\n    int minimumWhiteTiles(string floor, int numCarpets, int carpetLen) {\n      vector<vector<int>>dp(floor.size()+1,vector<int>(numCarpets+1,0));\n        return(solveTab(floor,numCarpets,carpetLen,dp));\n    }\n};\n```
['C++']