feat(content): hidden test cases

This commit is contained in:
2025-08-06 23:21:42 +01:00
parent 89b5dd1457
commit 6bed0a6787
134 changed files with 2075 additions and 0 deletions

View File

@@ -8,6 +8,22 @@ categories:
patterns:
- matrix-traversal
function_signature: "def generate_matrix(n: int) -> list[list[int]]:"
test_cases:
visible:
- input: { n: 3 }
expected: [[1, 2, 3], [8, 9, 4], [7, 6, 5]]
- input: { n: 1 }
expected: [[1]]
hidden:
- input: { n: 2 }
expected: [[1, 2], [4, 3]]
- input: { n: 4 }
expected: [[1, 2, 3, 4], [12, 13, 14, 5], [11, 16, 15, 6], [10, 9, 8, 7]]
- input: { n: 5 }
expected: [[1, 2, 3, 4, 5], [16, 17, 18, 19, 6], [15, 24, 25, 20, 7], [14, 23, 22, 21, 8], [13, 12, 11, 10, 9]]
description: |
Given a positive integer `n`, generate an `n x n` matrix filled with elements from `1` to `n^2` in spiral order.