Skip to content

pokerhand

bradendubois edited this page Jul 18, 2021 · 7 revisions

Poker Hand

ID: pokerhand

Difficulty: 1.4

CPU Time: 1 second

Memory: 1024 MB

Solution

One can read in the first character of each card (the suits are totally irrelevant) into a list, and loop through the list, picking a rank, and then doing a nested loop to count all occurrences of that rank, and tally them up, keeping track of the highest number of one rank seen.

Clone this wiki locally