Matrix — Reasoning Check

Apply the module invariants, traces, and boundary conditions.


Get every question correct to pass this checkpoint. You can review feedback, revise your answers, and submit again.

1. After clockwise rotation of an n=4 square matrix, the original cell (1,3) is in row 3. What is its new column? Enter one integer.
2. Set Matrix Zeroes receives [[1,2,3],[4,0,6],[7,8,9]]. Why is immediately zeroing each discovered zero's row and column unsafe?

Select one answer.

3. Traverse [[2,4],[6,8],[10,12]] by increasing r+c, reversing direction on each diagonal and starting at the top-left. The first three emitted values are 2,4,6. What is the fourth value? Enter one integer.
4. During Game of Life encoding, a neighboring cell currently stores 2 (binary 10). How should it contribute to another cell's OLD live-neighbor count?

Select one answer.

5. A 9-by-9 Sudoku board has a 4 at (0,0) and another 4 at (0,4), with every other cell empty. How many rule families fail: row, column, and box? Enter one integer.
6. In a one-row spiral traversal, the top sweep emits every cell and increments top past bottom. What prevents the reverse bottom sweep from emitting them again?

Select one answer.

Join Discord