feat(content): function signatures + test cases
This commit is contained in:
@@ -11,6 +11,30 @@ patterns:
|
||||
- greedy
|
||||
- heap
|
||||
|
||||
function_signature: "def is_n_straight_hand(hand: list[int], group_size: int) -> bool:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { hand: [1, 2, 3, 6, 2, 3, 4, 7, 8], group_size: 3 }
|
||||
expected: true
|
||||
- input: { hand: [1, 2, 3, 4, 5], group_size: 4 }
|
||||
expected: false
|
||||
hidden:
|
||||
- input: { hand: [1], group_size: 1 }
|
||||
expected: true
|
||||
- input: { hand: [1, 2, 3], group_size: 1 }
|
||||
expected: true
|
||||
- input: { hand: [1, 2, 3], group_size: 3 }
|
||||
expected: true
|
||||
- input: { hand: [1, 2, 4], group_size: 3 }
|
||||
expected: false
|
||||
- input: { hand: [1, 1, 2, 2, 3, 3], group_size: 3 }
|
||||
expected: true
|
||||
- input: { hand: [1, 2, 3, 4, 5, 6], group_size: 2 }
|
||||
expected: false
|
||||
- input: { hand: [8, 10, 12], group_size: 3 }
|
||||
expected: false
|
||||
|
||||
description: |
|
||||
Alice has some number of cards and she wants to rearrange the cards into groups so that each group is of size `groupSize`, and consists of `groupSize` consecutive cards.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user