A dice game rolls five dice. Faces are 1 to 6, and a face of 0 is a joker: each joker
may count as any face from 1 to 6 (different jokers may count as different faces). Write
best_hand(dice) that returns the name of the best category the roll can make.
Categories from best to worst (a roll belongs to the first one it satisfies):
"five of a kind": all five faces equal."large straight": the faces are exactly 1,2,3,4,5 or exactly 2,3,4,5,6 in some order."four of a kind": four faces equal."full house": three faces equal and the other two equal to each other (but different)."small straight": four of the faces are 1,2,3,4 or 2,3,4,5 or 3,4,5,6."three of a kind": three faces equal."two pair": two different faces each appear at least twice."pair": some face appears twice."nothing".
Examples
Input: dice = [3, 1, 4, 1, 5]
Output: "pair"
Input: dice = [2, 6, 0, 4, 5]
Output: "large straight"
Explanation: the joker counts as a 3.
Input: dice = [6, 6, 1, 1, 0]
Output: "full house"
Constraints
len(dice) == 5- every value is an integer from
0to6
Goals
- Classify a hand by counting faces
- Rank overlapping categories with a fixed priority
- Try every value a wild card could take