← ALL NOTES
Array

73. Set Matrix Zeroes

The trap is right there in the problem: if you zero a cell's row and column as you find it, those fresh zeros get mistaken for original ones and cascade, wiping the whole matrix. So separate the two…

Loading…