feat(content): more test cases

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

View File

@@ -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.