feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent b434eb3a49
commit a7d29b7cce
203 changed files with 4526 additions and 0 deletions

View File

@@ -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.