Minimum Number of Planks to Cover Holes in a Grid
Given an m×n grid where some cells contain holes, find the minimum number of planks needed to cover all holes. A horizontal plank covers all cells in a single row (1×n), and a vertical plank covers all cells in a single column (m×1). A plank covers a hole if it passes through that cell. Find the minimum number of planks (horizontal or vertical) such that every hole is covered by at least one plank.
Asked at:
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early December, 2024
Mid-level
Find the minimum number of planks needed to cover all holes in a grid. Given an m x n grid with some squares containing holes, use 1 x n planks (covering a row in one column) or m x 1 planks (covering a column in one row) to cover all holes.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.