Dp solution(c++ 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```\nclass Solution {\n    int f(int ind,int count,string  &s,int carpetlen,vector<vector<int>>&dp){\n        if(count<0)return -1e9;\n        if(ind >= s.size())return 0;\n\n        if(dp[ind][count]!=-1)return dp[ind][count];\n        int color = -1e9;\n        int notcolor = -1e9;\n        if(s[ind] == \'0\'){\n            notcolor = 1 + f(ind+1,count,s,carpetlen,dp);//we donot need to color this index as it is laredy black \n        }\n        else if(s[ind] == \'1\'){\n            notcolor = f(ind+1,count,s,carpetlen,dp);\n            if(ind+carpetlen >=s.size()){\n                color=(s.size() - ind);\n            }\n            else color=carpetlen;\n            color+=f(ind+carpetlen,count-1,s,carpetlen,dp);//color means we are coloring \n        }\n\n        return dp[ind][count] = max(color,notcolor);\n    }\npublic:\n    int minimumWhiteTiles(string floor, int numCarpets, int carpetLen) {\n        \n        int n = floor.size();\n        int count = numCarpets;\n        vector<vector<int>>dp(n,vector<int>(count+1,-1));\n        int k = f(0,count,floor,carpetLen,dp);\n        cout<<k<<endl;\n        return n - k;\n    }\n};\n```
['C++']