| 1 | Start with matrix | [[1,1,1],[1,0,1],[1,1,1]] | [] | [] | Initial matrix |
| 2 | Check cell (0,0) | [[1,1,1],[1,0,1],[1,1,1]] | [] | [] | Value is 1, no mark |
| 3 | Check cell (0,1) | [[1,1,1],[1,0,1],[1,1,1]] | [] | [] | Value is 1, no mark |
| 4 | Check cell (0,2) | [[1,1,1],[1,0,1],[1,1,1]] | [] | [] | Value is 1, no mark |
| 5 | Check cell (1,0) | [[1,1,1],[1,0,1],[1,1,1]] | [] | [] | Value is 1, no mark |
| 6 | Check cell (1,1) | [[1,1,1],[1,0,1],[1,1,1]] | [1] | [1] | Value is 0, mark row 1 and col 1 |
| 7 | Check cell (1,2) | [[1,1,1],[1,0,1],[1,1,1]] | [1] | [1] | Value is 1, no mark |
| 8 | Check cell (2,0) | [[1,1,1],[1,0,1],[1,1,1]] | [1] | [1] | Value is 1, no mark |
| 9 | Check cell (2,1) | [[1,1,1],[1,0,1],[1,1,1]] | [1] | [1] | Value is 1, no mark |
| 10 | Check cell (2,2) | [[1,1,1],[1,0,1],[1,1,1]] | [1] | [1] | Value is 1, no mark |
| 11 | Set zeros in marked rows and columns | [[1,1,1],[1,0,1],[1,1,1]] | [1] | [1] | Start updating matrix |
| 12 | Update cell (0,0) | [[1,1,1],[1,0,1],[1,1,1]] | [1] | [1] | No zero row or col, keep 1 |
| 13 | Update cell (0,1) | [[1,1,1],[1,0,1],[1,1,1]] | [1] | [1] | Column 1 marked, set to 0 |
| 14 | Update cell (0,2) | [[1,0,1],[1,0,1],[1,1,1]] | [1] | [1] | No zero row or col, keep 1 |
| 15 | Update cell (1,0) | [[1,0,1],[1,0,1],[1,1,1]] | [1] | [1] | Row 1 marked, set to 0 |
| 16 | Update cell (1,1) | [[1,0,1],[0,0,1],[1,1,1]] | [1] | [1] | Row 1 or col 1 marked, set to 0 |
| 17 | Update cell (1,2) | [[1,0,1],[0,0,1],[1,1,1]] | [1] | [1] | Row 1 marked, set to 0 |
| 18 | Update cell (2,0) | [[1,0,1],[0,0,0],[1,1,1]] | [1] | [1] | No zero row or col, keep 1 |
| 19 | Update cell (2,1) | [[1,0,1],[0,0,0],[1,1,1]] | [1] | [1] | Column 1 marked, set to 0 |
| 20 | Update cell (2,2) | [[1,0,1],[0,0,0],[1,0,1]] | [1] | [1] | No zero row or col, keep 1 |
| 21 | End | [[1,0,1],[0,0,0],[1,0,1]] | [1] | [1] | Matrix updated in place |