Code
The highlighted line runs next. The pill shows the live values in the running call.
Variables
The data structures the code is building
Matrix
Crosshair = the row and column of the cell being checked; new zeros ripple outward
Given an m × n matrix, if an element is 0, set its entire row and column to 0. Do it in place. Follow-up: can you use only O(1) extra space?
The highlighted line runs next. The pill shows the live values in the running call.
The data structures the code is building
Crosshair = the row and column of the cell being checked; new zeros ripple outward
m rows, n columns. The highlighted row is the solution being traced.
Keyboard: ← → step, Space play or pause. Enter any matrix up to 6 × 6 like [[1,2,3],[4,0,5]]; all rows must be the same length.