feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent e28da5def2
commit 0f264ef603
94 changed files with 1840 additions and 0 deletions

View File

@@ -9,6 +9,22 @@ categories:
patterns:
- matrix-traversal
function_signature: "def set_zeroes(matrix: list[list[int]]) -> None:"
test_cases:
visible:
- input: { matrix: [[1, 1, 1], [1, 0, 1], [1, 1, 1]] }
expected: [[1, 0, 1], [0, 0, 0], [1, 0, 1]]
- input: { matrix: [[0, 1, 2, 0], [3, 4, 5, 2], [1, 3, 1, 5]] }
expected: [[0, 0, 0, 0], [0, 4, 5, 0], [0, 3, 1, 0]]
hidden:
- input: { matrix: [[1, 2, 3], [4, 5, 6]] }
expected: [[1, 2, 3], [4, 5, 6]]
- input: { matrix: [[0]] }
expected: [[0]]
- input: { matrix: [[1, 0, 3]] }
expected: [[0, 0, 0]]
description: |
Given an `m x n` integer matrix `matrix`, if an element is `0`, set its entire row and column to `0`'s.