Combinatorics Represent A 5 Card Poker Hand Computer Science Stack Change
For the others, you have to do a second ordering pass that orders by grouping. For example a full house could be xxxyy, a pair can be xxabc, (with a, b, and c in order), and so on. That work is usually done for you anyway, by the type.