Back to problems

Playing Cards: Straight Flush / Missing Card

Algorithm · Pinduoduo · Medium

Requirements Given a collection of character or value representations of playing cards, analyze their ranks and, when applicable, their suits. Two related tasks may be asked: Straight-flush detection: decide whether five cards of one suit have five consecutive ranks, or identify the cards that satisfy this condition. Straight completion: for a hand that is one card short of a straight, determine the rank of the card needed to complete it. The value 0 is ambiguous: it may…

Loading the rest of the question…