feat(content): function signatures + test cases
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user