Day 3 of Advent of Code 2025
The escalator at the North Pole is broken, and you need to fix it. Part one was simple enough.
BUT
In part two, you’re picking 12 digits from 100 to form the largest number.
Brute force it you say??
C(100,12) = 1,050,421,051,106,700 combinations per row. With 200 rows, that’s 210 quadrillion total.
That would take, uh, a while… even on a speedy computer.
Using a greedy algorithm: 1,200 operations per row.
1200 is SLIGHTLY less than 210 quadrillion (210,084,210,221,340,000 to be exact)
~1 trillion times faster. Math is fun.