:santa: Day 21 solutions discussion
# advent-of-code
d
🎅 Day 21 solutions discussion
I don't know about ya'll but Kotlin's
.toSortedMap().values
was very helpful in Part 2 for me.
a
I reused some code from Day 15: Rambunctious Recitation to find the specific allergen -> ingredient mapping for Part 2. Might need to put that into a utility file for future years 🙂
👍 1
n
Crazy how much easier than yesterday
d
Indeed. When I first read it I was like "YES!"
n
For a brief moment in part 2, after the code ran I didn't reduce the possibilities for the allergens to 1 ingredient each, and I was like "aha, today I'll have to actually do search/backtracking"
and then it turned out that I forgot to actually propagate the trivial constraint as I looped through and found allergens that already had one possibility
And so... yeah it was very trivial. The difficulty curve on these is super uneven.
l
Way easier than yesterday indeed
e
similar to day 16 but easier
http://www.maurits.vdschee.nl/scatterplot/ the difficulty curve this year seems very low overall, although this chart is also affected by the record number of participants
d
I think it's been easier too. Maybe Eric's giving us a break due to the current world situation? I'm still haunted by the terror of the water-filling simulation problem.
e
ah, I was only doing 3 languages that year 😄 I liked that puzzle
e
as opposed to ~200 LoC for yesterday
n
I keep getting surprised that these problems involving constraints, IIRC, have not required actual search/backtracking a single time yet
t
I do like that he puts the harder problems on the weekends. And so far, this year seems a lot easier than last year. There were a couple last year that I really struggled with.
b
40 lines, took me 15 min
I spent a most of it on part 1, part2 took me one line and maybe 10-15 seconds to find
That's my raw output, didn't try to clean yet
just pushed my explanations
Nice and clean approach @todd.ginsberg