feat(content): more test cases
This commit is contained in:
@@ -9,6 +9,24 @@ categories:
|
||||
patterns:
|
||||
- monotonic-stack
|
||||
|
||||
function_signature: "def asteroid_collision(asteroids: list[int]) -> list[int]:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { asteroids: [5, 10, -5] }
|
||||
expected: [5, 10]
|
||||
- input: { asteroids: [8, -8] }
|
||||
expected: []
|
||||
- input: { asteroids: [10, 2, -5] }
|
||||
expected: [10]
|
||||
hidden:
|
||||
- input: { asteroids: [-2, -1, 1, 2] }
|
||||
expected: [-2, -1, 1, 2]
|
||||
- input: { asteroids: [1, -1, -2, -2] }
|
||||
expected: [-2, -2]
|
||||
- input: { asteroids: [1, -2, -2, -2] }
|
||||
expected: [-2, -2, -2]
|
||||
|
||||
description: |
|
||||
We are given an array `asteroids` of integers representing asteroids in a row. The indices of the asteroids in the array represent their relative position in space.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user