Back to problems

Poker Hand Game Checker

Algorithm · Scale AI · Medium

You receive a hand containing exactly 5 cards from a standard 52-card deck. Every card is a string formatted as " of ". can be "2" through "10", "J", "Q", "K", or "A". is one of "hearts", "diamonds", "clubs", or "spades". A hand is valid when it satisfies one or more of these traditional poker patterns: Royal Flush: The cards are exactly "10", "J", "Q", "K", "A" and all belong to the same suit. Straight Flush: Five cards of the same suit whose ranks are consecutive,…

Checking your access…