feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent d65ccf7dc2
commit 0262ca8bf6
203 changed files with 4526 additions and 0 deletions

View File

@@ -9,6 +9,30 @@ categories:
patterns:
- greedy
function_signature: "def best_hand(ranks: list[int], suits: list[str]) -> str:"
test_cases:
visible:
- input: { ranks: [13, 2, 3, 1, 9], suits: ["a", "a", "a", "a", "a"] }
expected: "Flush"
- input: { ranks: [4, 4, 2, 4, 4], suits: ["d", "a", "a", "b", "c"] }
expected: "Three of a Kind"
- input: { ranks: [10, 10, 2, 12, 9], suits: ["a", "b", "c", "a", "d"] }
expected: "Pair"
hidden:
- input: { ranks: [1, 2, 3, 4, 5], suits: ["a", "b", "c", "d", "a"] }
expected: "High Card"
- input: { ranks: [3, 3, 3, 3, 5], suits: ["a", "b", "c", "d", "a"] }
expected: "Three of a Kind"
- input: { ranks: [1, 1, 2, 2, 3], suits: ["a", "b", "c", "d", "a"] }
expected: "Pair"
- input: { ranks: [7, 7, 7, 7, 7], suits: ["a", "a", "a", "a", "a"] }
expected: "Flush"
- input: { ranks: [13, 13, 13, 1, 1], suits: ["b", "c", "d", "a", "b"] }
expected: "Three of a Kind"
- input: { ranks: [2, 4, 6, 8, 10], suits: ["d", "d", "d", "d", "d"] }
expected: "Flush"
description: |
You are given an integer array `ranks` and a character array `suits`. You have `5` cards where the i<sup>th</sup> card has a rank of `ranks[i]` and a suit of `suits[i]`.