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

@@ -10,6 +10,26 @@ categories:
patterns:
- monotonic-stack
function_signature: "def get_collision_times(cars: list[list[int]]) -> list[float]:"
test_cases:
visible:
- input: { cars: [[1, 2], [2, 1], [4, 3], [7, 2]] }
expected: [1.0, -1.0, 3.0, -1.0]
- input: { cars: [[3, 4], [5, 4], [6, 3], [9, 1]] }
expected: [2.0, 1.0, 1.5, -1.0]
hidden:
- input: { cars: [[1, 1]] }
expected: [-1.0]
- input: { cars: [[1, 2], [2, 1]] }
expected: [1.0, -1.0]
- input: { cars: [[1, 1], [2, 2], [3, 3]] }
expected: [-1.0, -1.0, -1.0]
- input: { cars: [[1, 3], [2, 2], [3, 1]] }
expected: [1.0, 1.0, -1.0]
- input: { cars: [[5, 2], [6, 2], [7, 2]] }
expected: [-1.0, -1.0, -1.0]
description: |
There are `n` cars traveling at different speeds in the same direction along a one-lane road. You are given an array `cars` of length `n`, where `cars[i] = [position_i, speed_i]` represents: