Algo - matrix Flashcards

1
Q
  1. Stamping the Grid
  2. given a matrix with 0 is empty, 1 is blocked
  3. given an infinite number of stamps of width and height
  4. check if can cover all empty with stamps
    Notices:
  5. stamp must stay within the grid
  6. stamps can be overlapped by other
  7. stamp cannot cover blocked cell
A
  1. prefixSums: to sum sub-matrix => know if can put a stamp at current cell or not. If yes, put a stamp there. Note: must check range of cornerRow, cornerCol
  2. prefixSumStamps: to sum sub-matrix of cell with stamps
  3. using prefixSumStamps to check each cell if has already been covered
How well did you know this?
1
Not at all
2
3
4
5
Perfectly