feat(content): function signatures + test cases
This commit is contained in:
@@ -8,6 +8,28 @@ categories:
|
||||
patterns:
|
||||
- greedy
|
||||
|
||||
function_signature: "def add_rungs(rungs: list[int], dist: int) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { rungs: [1, 3, 5, 10], dist: 2 }
|
||||
expected: 2
|
||||
- input: { rungs: [3, 6, 8, 10], dist: 3 }
|
||||
expected: 0
|
||||
- input: { rungs: [3, 4, 6, 7], dist: 2 }
|
||||
expected: 1
|
||||
hidden:
|
||||
- input: { rungs: [5], dist: 10 }
|
||||
expected: 0
|
||||
- input: { rungs: [10], dist: 3 }
|
||||
expected: 3
|
||||
- input: { rungs: [1, 100], dist: 10 }
|
||||
expected: 9
|
||||
- input: { rungs: [1, 2, 3, 4, 5], dist: 1 }
|
||||
expected: 0
|
||||
- input: { rungs: [4, 8, 12, 16], dist: 3 }
|
||||
expected: 4
|
||||
|
||||
description: |
|
||||
You are given a **strictly increasing** integer array `rungs` that represents the **height** of rungs on a ladder. You are currently on the **floor** at height `0`, and you want to reach the last rung.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user