Last active
April 13, 2022 05:26
-
-
Save tt293/4e17d3578477fd3832f55c73bd45c220 to your computer and use it in GitHub Desktop.
Leduc Hold'em Hand Ranks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rank(hand: List[str]) -> int: | |
ranks = { | |
'KK': 1, | |
'QQ': 2, | |
'JJ': 3, | |
'KQ': 4, 'QK': 4, | |
'KJ': 5, 'JK': 5, | |
'QJ': 6, 'JQ': 6 | |
} | |
cards = hand[0][0] + hand[1][0] | |
return ranks[cards] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment