Source: Day 7: Camel Cards
Full solution for today (spoilers!)
Part 1
Simulate a limited poker game with no suits and break otherwise tied hands lexicographically (
AAAA2beatsAKAAA) because the the hands are both four of a kind, the first cards are bothA, but the secondAbeats theK. It doesn’t matter that the first hand’s off card was a2Order all hands then calculate the sum of the ordering of hands (1 for best etc) times the bet for each.
