Poker hand ranking algorithm