Back to problems

Poker Straight Sequence Check

Algorithm · Oracle · Easy

You draw exactly five cards from a standard deck. Determine whether these five cards form a straight — a run of five consecutive ranks, irrespective of suit. Ranks are represented as the strings "A", "2" through "10", "J", "Q", and "K". The Ace ("A") may serve as the low end of a straight (value 1) or the high end (value 14), but not both in the same hand. All five cards are distinct, and their order in the input does not matter. Return true if the hand can be arranged into…

Checking your access…