feat(content): hidden test cases
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user