Back to problems

Extensible Card Hand Comparison Game

Algorithm · OpenAI · Medium

Build a comparator for three-card poker hands that is easy to extend. Every card carries a rank and a suit, with the face cards J, Q and K written as the numbers 11, 12 and 13. Given one hand for Player A and one for Player B, decide the outcome and return an evaluation log describing how that outcome was reached. Phase 1 defines three hand categories, listed here from the highest to the lowest: Three of a Kind — the three cards share one rank. Pair — precisely two of the…

Loading the rest of the question…