Skip to content

Commit

Permalink
Finished prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhbaek committed Jul 24, 2018
1 parent 2a0fa74 commit ea0ae0c
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions Coding_Challenges/Poker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,35 @@ Poker
Prompt
======

Create a function that takes in two poker hands and returns the winning hand.
Create a function that takes in two poker hands and returns the winning hand. Return 'TIE' if the hands are tied.

Each hand will be an array of five objects, where each object has a suit and value property.

Don’t worry about tie breaks; ie if the two hands are the same, don’t worry about which straight or flush is stronger than the other.

EXCEPTION: The ONLY tiebreak to consider is a Royal Straight Flush, which should beat any other Straight Flush

Link for poker hands: http://img.rankplan.net/p/3/pokerhands_big.jpg


Example to give
```
Input: [4, 1, 8, 7]
Output: True
Explanation: (8-4) * (7-1) = 24
Input: (hand1, hand2)
hand 1 =
[ {value: 1,suit: 'spade'},
{value: 3,suit: 'spade'},
{value: 11,suit: 'spade'},
{value: 14,suit: 'spade'},
{value: 7,suit: 'spade'} ]
hand 2 =
[ {value: 1, suit: 'spade'},
{value: 1, suit: 'diamond'},
{value: 11, suit: 'diamond'},
{value: 11, suit: 'heart'},
{value: 7, suit: 'club'} ]
Input: [1, 2, 1, 2]
Output: False
Output: hand1
Explanation: hand1 is a flush, while hand2 is a two pair
```

0 comments on commit ea0ae0c

Please sign in to comment.