Skip to content

lytrungtin/poker-hands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Poker_hands

Given an input of 5 strings that each represent a playing card.

Output a valid poker hand.

・A card is represented as a string that combines a char that represents a Suit and a string that represents a Rank.

○The chars that represent a Suit are, S(=Spades♠), H(=Hearts♡), D(=Diamonds♢), C(=Clovers♣).

○The strings that represent a Rank are 2, 3, …, 9, 10, J, Q, K, A.  

○For example, D3 means 3 of Diamonds. CA means A of Clovers.

・The poker hands are shown in Table 1. If the 5 cards produce no hands, the output is “--”.

・Cards don’t include a Joker and there are 52 cards in the deck.

For example, if the input string is D4C4C8D8S4, then there is a Full House, so output is FH.

if the input string is S8D3HQS3CQ, it has Two pairs. the output is 2P.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages