feat(content): more test cases

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

View File

@@ -8,6 +8,24 @@ categories:
patterns:
- matrix-traversal
function_signature: "def spiral_order(matrix: list[list[int]]) -> list[int]:"
test_cases:
visible:
- input: { matrix: [[1, 2, 3], [4, 5, 6], [7, 8, 9]] }
expected: [1, 2, 3, 6, 9, 8, 7, 4, 5]
- input: { matrix: [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]] }
expected: [1, 2, 3, 4, 8, 12, 11, 10, 9, 5, 6, 7]
hidden:
- input: { matrix: [[1]] }
expected: [1]
- input: { matrix: [[1, 2, 3, 4]] }
expected: [1, 2, 3, 4]
- input: { matrix: [[1], [2], [3]] }
expected: [1, 2, 3]
- input: { matrix: [[1, 2], [3, 4]] }
expected: [1, 2, 4, 3]
description: |
Given an `m x n` `matrix`, return *all elements of the matrix in spiral order*.