feat(content): more test cases
This commit is contained in:
@@ -9,6 +9,22 @@ categories:
|
||||
patterns:
|
||||
- matrix-manipulation
|
||||
|
||||
function_signature: "def rotate(matrix: list[list[int]]) -> None:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { matrix: [[1, 2, 3], [4, 5, 6], [7, 8, 9]] }
|
||||
expected: [[7, 4, 1], [8, 5, 2], [9, 6, 3]]
|
||||
- input: { matrix: [[5, 1, 9, 11], [2, 4, 8, 10], [13, 3, 6, 7], [15, 14, 12, 16]] }
|
||||
expected: [[15, 13, 2, 5], [14, 3, 4, 1], [12, 6, 8, 9], [16, 7, 10, 11]]
|
||||
hidden:
|
||||
- input: { matrix: [[1]] }
|
||||
expected: [[1]]
|
||||
- input: { matrix: [[1, 2], [3, 4]] }
|
||||
expected: [[3, 1], [4, 2]]
|
||||
- input: { matrix: [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]] }
|
||||
expected: [[13, 9, 5, 1], [14, 10, 6, 2], [15, 11, 7, 3], [16, 12, 8, 4]]
|
||||
|
||||
description: |
|
||||
You are given an `n × n` 2D matrix representing an image. Rotate the image by **90 degrees** (clockwise).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user