feat(content): function signatures + test cases
This commit is contained in:
@@ -9,6 +9,26 @@ categories:
|
||||
patterns:
|
||||
- greedy
|
||||
|
||||
function_signature: "def average(salary: list[int]) -> float:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { salary: [4000, 3000, 1000, 2000] }
|
||||
expected: 2500.0
|
||||
- input: { salary: [1000, 2000, 3000] }
|
||||
expected: 2000.0
|
||||
hidden:
|
||||
- input: { salary: [6000, 5000, 4000, 3000, 2000, 1000] }
|
||||
expected: 3500.0
|
||||
- input: { salary: [8000, 9000, 2000, 3000, 6000, 1000] }
|
||||
expected: 4750.0
|
||||
- input: { salary: [48000, 59000, 99000, 13000, 78000, 45000, 31000, 17000, 39000, 37000, 93000, 77000, 33000, 28000, 4000, 54000, 67000, 6000, 1000, 11000] }
|
||||
expected: 41111.11111111111
|
||||
- input: { salary: [1000, 1001, 1002] }
|
||||
expected: 1001.0
|
||||
- input: { salary: [100000, 200000, 300000] }
|
||||
expected: 200000.0
|
||||
|
||||
description: |
|
||||
You are given an array of **unique** integers `salary` where `salary[i]` is the salary of the i<sup>th</sup> employee.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user