feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent d65ccf7dc2
commit 0262ca8bf6
203 changed files with 4526 additions and 0 deletions

View File

@@ -9,6 +9,24 @@ categories:
patterns:
- matrix-traversal
function_signature: "def check_x_matrix(grid: list[list[int]]) -> bool:"
test_cases:
visible:
- input: { grid: [[2, 0, 0, 1], [0, 3, 1, 0], [0, 5, 2, 0], [4, 0, 0, 2]] }
expected: true
- input: { grid: [[5, 7, 0], [0, 3, 1], [0, 5, 0]] }
expected: false
hidden:
- input: { grid: [[1, 0, 1], [0, 1, 0], [1, 0, 1]] }
expected: true
- input: { grid: [[1, 0, 0], [0, 1, 0], [0, 0, 1]] }
expected: false
- input: { grid: [[0, 0, 1], [0, 1, 0], [1, 0, 0]] }
expected: false
- input: { grid: [[5, 0, 5], [0, 5, 0], [5, 0, 5]] }
expected: true
description: |
A square matrix is said to be an **X-Matrix** if **both** of the following conditions hold: