feat(content): function signatures + test cases
This commit is contained in:
@@ -10,6 +10,28 @@ categories:
|
||||
patterns:
|
||||
- backtracking
|
||||
|
||||
function_signature: "def judge_point24(cards: list[int]) -> bool:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { cards: [4, 1, 8, 7] }
|
||||
expected: true
|
||||
- input: { cards: [1, 2, 1, 2] }
|
||||
expected: false
|
||||
hidden:
|
||||
- input: { cards: [8, 3, 8, 3] }
|
||||
expected: true
|
||||
- input: { cards: [1, 1, 1, 1] }
|
||||
expected: false
|
||||
- input: { cards: [1, 5, 5, 5] }
|
||||
expected: true
|
||||
- input: { cards: [3, 3, 8, 8] }
|
||||
expected: true
|
||||
- input: { cards: [1, 9, 1, 2] }
|
||||
expected: true
|
||||
- input: { cards: [1, 1, 7, 7] }
|
||||
expected: false
|
||||
|
||||
description: |
|
||||
You are given an integer array `cards` of length `4`. You have four cards, each containing a number in the range `[1, 9]`. You should arrange the numbers on these cards in a mathematical expression using the operators `['+', '-', '*', '/']` and the parentheses `'('` and `')'` to get the value 24.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user