Algorithm · Upstart · Medium
Problem 1 An $$m \times n$$ grid is filled with 0s and 1s. A 1 means a block occupies that cell. Coordinates are 0-based. A block at (r, c) may be removed only if, in the current grid, row r has no surviving block at any column greater than c. Remove blocks one by one until all 1s are gone. Return a list of coordinate pairs representing one valid order of removal. If several removal orders are possible, any one is accepted. If the grid contains no block, return an empty…
Checking your access…