feat(content): function signatures + test cases
This commit is contained in:
@@ -10,6 +10,32 @@ patterns:
|
||||
- dynamic-programming
|
||||
- backtracking
|
||||
|
||||
function_signature: "def can_i_win(max_choosable: int, desired_total: int) -> bool:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { max_choosable: 10, desired_total: 11 }
|
||||
expected: false
|
||||
- input: { max_choosable: 10, desired_total: 0 }
|
||||
expected: true
|
||||
- input: { max_choosable: 10, desired_total: 1 }
|
||||
expected: true
|
||||
hidden:
|
||||
- input: { max_choosable: 1, desired_total: 1 }
|
||||
expected: true
|
||||
- input: { max_choosable: 1, desired_total: 2 }
|
||||
expected: false
|
||||
- input: { max_choosable: 4, desired_total: 6 }
|
||||
expected: true
|
||||
- input: { max_choosable: 5, desired_total: 50 }
|
||||
expected: false
|
||||
- input: { max_choosable: 10, desired_total: 40 }
|
||||
expected: false
|
||||
- input: { max_choosable: 20, desired_total: 210 }
|
||||
expected: false
|
||||
- input: { max_choosable: 3, desired_total: 5 }
|
||||
expected: true
|
||||
|
||||
description: |
|
||||
In the "100 game" two players take turns adding, to a running total, any integer from `1` to `10`. The player who first causes the running total to **reach or exceed** 100 wins.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user