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

@@ -11,6 +11,28 @@ patterns:
- two-pointers
- greedy
function_signature: "def bag_of_tokens_score(tokens: list[int], power: int) -> int:"
test_cases:
visible:
- input: { tokens: [100], power: 50 }
expected: 0
- input: { tokens: [200, 100], power: 150 }
expected: 1
- input: { tokens: [100, 200, 300, 400], power: 200 }
expected: 2
hidden:
- input: { tokens: [], power: 100 }
expected: 0
- input: { tokens: [100], power: 100 }
expected: 1
- input: { tokens: [100, 100, 100], power: 200 }
expected: 2
- input: { tokens: [71, 55, 82], power: 54 }
expected: 0
- input: { tokens: [26, 33, 59], power: 45 }
expected: 1
description: |
You start with an initial **power** of `power`, an initial **score** of `0`, and a bag of tokens given as an integer array `tokens`, where each `tokens[i]` denotes the value of the i<sup>th</sup> token.