Skip to content

Instantly share code, notes, and snippets.

@tt293
Last active April 13, 2022 05:26
Show Gist options
  • Save tt293/4e17d3578477fd3832f55c73bd45c220 to your computer and use it in GitHub Desktop.
Save tt293/4e17d3578477fd3832f55c73bd45c220 to your computer and use it in GitHub Desktop.
Leduc Hold'em Hand Ranks
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