ThreeCardsDraw
Rookie SRM 17 · 2022-09-22 · by erinn
Problem Statement
You have a standard deck of playing cards, containing 52 cards in 4 suits and 13 values. The values are Ace (1), 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack (10), Queen (10), and King (10).
You are given
Notes
- Notes that aces have a value of 1, while jacks, queens and kings have a value of 10.
Constraints
- total will be between 3 and 30, inclusive.
3 Returns: 1.8099547511312217E-4
The only way this can happen is to pick three of the four aces.
30 Returns: 0.025339366515837104
5 Returns: 0.0021719457013574662
There's a few ways to select three cards and get a total of 5.
15 Returns: 0.05085972850678733
20 Returns: 0.06660633484162896
Submissions are judged against all 6 archived test cases, of which 5 are shown here. Case numbers match the judge’s.
Language: C++17 · define a public class ThreeCardsDraw with a public method double totalChance(int total) · 6 test cases · 2 s / 256 MB per case