feat(content): function signatures + test cases
This commit is contained in:
@@ -10,6 +10,30 @@ patterns:
|
||||
- prefix-sum
|
||||
- intervals
|
||||
|
||||
function_signature: "def car_pooling(trips: list[list[int]], capacity: int) -> bool:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { trips: [[2, 1, 5], [3, 3, 7]], capacity: 4 }
|
||||
expected: false
|
||||
- input: { trips: [[2, 1, 5], [3, 3, 7]], capacity: 5 }
|
||||
expected: true
|
||||
hidden:
|
||||
- input: { trips: [[1, 0, 1]], capacity: 1 }
|
||||
expected: true
|
||||
- input: { trips: [[2, 0, 5]], capacity: 1 }
|
||||
expected: false
|
||||
- input: { trips: [[3, 2, 7], [3, 7, 9], [8, 3, 9]], capacity: 11 }
|
||||
expected: true
|
||||
- input: { trips: [[2, 1, 5], [3, 5, 7]], capacity: 3 }
|
||||
expected: true
|
||||
- input: { trips: [[10, 0, 1], [10, 1, 2], [10, 2, 3]], capacity: 10 }
|
||||
expected: true
|
||||
- input: { trips: [[9, 0, 1], [3, 3, 7]], capacity: 4 }
|
||||
expected: false
|
||||
- input: { trips: [[4, 0, 5], [4, 3, 8], [2, 5, 10]], capacity: 6 }
|
||||
expected: false
|
||||
|
||||
description: |
|
||||
There is a car with `capacity` empty seats. The vehicle only drives east (i.e., it cannot turn around and drive west).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user