feat(content): function signatures + test cases
This commit is contained in:
@@ -8,6 +8,26 @@ categories:
|
||||
patterns:
|
||||
- greedy
|
||||
|
||||
function_signature: "def average_waiting_time(customers: list[list[int]]) -> float:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { customers: [[1, 2], [2, 5], [4, 3]] }
|
||||
expected: 5.0
|
||||
- input: { customers: [[5, 2], [5, 4], [10, 3], [20, 1]] }
|
||||
expected: 3.25
|
||||
hidden:
|
||||
- input: { customers: [[1, 1]] }
|
||||
expected: 1.0
|
||||
- input: { customers: [[1, 5], [2, 3], [3, 2]] }
|
||||
expected: 5.0
|
||||
- input: { customers: [[1, 1], [2, 1], [3, 1]] }
|
||||
expected: 1.0
|
||||
- input: { customers: [[1, 10], [1, 10], [1, 10]] }
|
||||
expected: 20.0
|
||||
- input: { customers: [[10, 5], [20, 5], [30, 5]] }
|
||||
expected: 5.0
|
||||
|
||||
description: |
|
||||
There is a restaurant with a single chef. You are given an array `customers`, where `customers[i] = [arrival_i, time_i]`:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user