You are given a binary string floor representing the colors of tiles along a floor, where floor[i] = i is white, and floor[i] = i is black.
You are also given two integers numCarpets and carpetLen. You have numCarpets black carpets, each of length carpetLen tiles. Each carpet can cover carpetLen consecutive tiles on the floor.
Return the minimum number of white tiles that remain visible after optimally placing the carpets.
Note: Carpets are permitted to overlap with each other.
Constraints:
carpetLen floor.length
floor[i] is either
numCarpets
You are given a binary string floor representing the colors of tiles along a floor, where floor[i] = i is white, and floor[i] = i is black.
You are also given two integers numCarpets and carpetLen. You have numCarpets black carpets, each of length carpetLen tiles. Each carpet can cover carpetLen consecutive tiles on the floor.
Return the minimum number of white tiles that remain visible after optimally placing the carpets.
Note: Carpets are permitted to overlap with each other.
Constraints:
carpetLen floor.length
floor[i] is either
numCarpets