Values = def check_straight_flush (hand ) : if check_flush (hand ) and check_straight (hand ) : return True else : return False def check_four_of_a_kind (hand ) : We can represent this as 3C.Ģ, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, Ace Suit and value make up the value of playing cards. For example, we can take out any combination of 2 cards from the hand we are given, but we must replace these two cards with the next two cards from the deck (we can't pick any two cards from the deck).
We want to exchange any n number of cards (where n <= 5) in our hand for the next n cards in the deck. We assume that we can see the next five cards (they are not hidden). We are given 10 cards, the first 5 are the current hand, and the second 5 are the next five cards in the deck. The hackerrank question asked me to write a program that would determine the best poker hand possible in five-card draw poker. In this article I want to do some reflection on how I approached the problem. I'm not a poker player, so I had a brief moment of panic as I read over the problem the description. I recently took a Hackerrank challenge for a job application that involved poker.