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,32 @@ categories:
patterns:
- greedy
function_signature: "def broken_calc(start_value: int, target: int) -> int:"
test_cases:
visible:
- input: { start_value: 2, target: 3 }
expected: 2
- input: { start_value: 5, target: 8 }
expected: 2
- input: { start_value: 3, target: 10 }
expected: 3
hidden:
- input: { start_value: 1, target: 1 }
expected: 0
- input: { start_value: 10, target: 5 }
expected: 5
- input: { start_value: 1, target: 1000000000 }
expected: 39
- input: { start_value: 1, target: 2 }
expected: 1
- input: { start_value: 1, target: 1024 }
expected: 10
- input: { start_value: 100, target: 1 }
expected: 99
- input: { start_value: 1, target: 17 }
expected: 6
description: |
There is a broken calculator that has the integer `startValue` on its display initially. In one operation, you can: