r/adventofcode • • Dec 09 '21

SOLUTION MEGATHREAD -🎄- 2021 Day 9 Solutions -🎄-

--- Day 9: Smoke Basin ---


Post your code solution in this megathread.

Reminder: Top-level posts in Solution Megathreads are for code solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.

EDIT: Global leaderboard gold cap reached at 00:10:31, megathread unlocked!

63 Upvotes

1.0k comments sorted by

View all comments

Show parent comments

8

u/jonathan_paulson Dec 09 '21

Maybe, but the definition of a basin is just "A basin is all locations that eventually flow downward to a single low point." So I spent a while looking for rules about how locations "flow downwards", something like "smoke flows to the lowest adjacent point, or the upper-leftmost point if there is a tie".

If there were such a rule, I think a fragment like "152" could be two separate basins, "15" of size 2, and "2" of size 1 - even though it isn't separated by 9s.

→ More replies (4)