About.com/40 - Best Poker Hands

40 - Best Poker Hands

 * http://cplus.about.com/od/programmingchallenges/a/Programming-Contest-40-best-poker-hands.htm

Summary
You are provided with a text file holding 1000 x 7 sets of cards (in no order). Your application must identify the best poker hand made up of 5 cards from the 7 provided. These cards are - or space separated and look like this: 3S-9D 5S-6D-TH-2S-KC. The first letter of each pair is the value which is one of 2,3,4,5,6,7,8,9,T,J,Q,K, A. The second letter of each pair are suits, and are H,C,D and S standing for hearts, clubs, diamonds and spades.

Explanation
Explanation of the ideas behind the solution goes here.

Gotchas

 * Any points one can easily overlook?
 * The correct way to understand ambiguous formulations?

Input
There is one file, located in the same folders as your exe called cards.txt. It contains 1000 entries, with the first five lines as follows: 3S-9D 5S-6D-TH-2S-KC 6H-QH 2C-4D-6C-QS-JH AD-6S KD-7H-2D-5C-5D 9C-8H 4C-QC-7C-2H-KS AC-8S JS-8C-8D-QD-TD

Output
The output file, "output.txt", must start with the average processing time per hand. For each line after that, it contains the best hand for a given line, with five cards delimited with '-', a space, and a code indicating the value of the hand.

The code is one of:
 * 1) SF Straight Flush - A straight flush is five cards in sequence, all of the same suit,
 * 2) FK Four of a Kind - Four cards, all the same value
 * 3) FH Full House - Three carsd of one value, and two of another
 * 4) FL Flush - Five cards all the same suit
 * 5) ST Straight - Five cards in the same sequence
 * 6) TK Three of a Kind- Three cards of the same value
 * 7) TP Two Pairs - Two sets of two paired cards
 * 8) OP One Pair - Two paired cards- ie the same value
 * 9) HC High Card - Highest value Card. Ace is highest, 2 is lowest

In the first row, one solution is as follows:

9D-5S-6D-TH-KC HC