C 5 card draw poker hand eval

broken image

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.

broken image