Whew. Finals weekend this weekend put me way off my pace. I'm still trying to finish up the math one from a few days ago. But I'm not giving up! Four more days! It looks like I'm not the only one either, with only two submissions yesterday! It definitely was a tough one.
The Puzzle
In today’s puzzle, we're simply trying to feed ourselves, but it's not going to be easy. The foods are listed with some of the allergens that are present. But not all, necessarily. So. Deal with that uncertainty.
The Leaderboards
As always, this is the spot where I’ll plug any leaderboard codes shared from the community.
Ryan's Leaderboard: 224198-25048a19
If you want to generate your own leaderboard and signal boost it a little bit, send it to me either in a DEV message or in a comment on one of these posts and I'll add it to the list above.
Yesterday’s Languages
Updated 09:23AM 12/21/2020 PST.
Language | Count |
---|---|
Python | 1 |
JavaScript | 1 |
Merry Coding!
Top comments (6)
Lots and lots of set theory
Part 2 result is at the end; Part 1 result is somewhere halfway down.
YEsterday was not fun Haskell, I did get it done, but it is horrible. Mostly my solution, some people on Reddit did it with mutable arrays, however, the whole point of doing AoC with Haskell, was to spend sometime programming in a purely functional language, for fun, away from my normal language of choice Rust and C++ if I have too. But in truth I think yesterday would have been a lot easier and more fun in Rust, at least for me :-)
Anyway today was a lot easier and got it done pretty quickly.
Finishing this one up a little late, but it's my second one completed today, so I'm catching back up! Lots of sets, but pretty straightforward once I figured out how you could possibly even rule things in or out for sure. The code came out simpler than I expected.
Felt like a replay of day 16.
My first solution used lots and lots of string copies. Then I refactored it to use slices of the original parsed string all the way through, just to prove to myself I understand Rust lifetimes and ownership. Works!
Another javascript gist. It's been a few days since i could solve both parts.
Today's solution took a "by eye" shortcut, as I could see I only needed three iterations, rather than figuring out the stopping condition.
Today was a lot more enjoyable than yesterday! Here is my JavaScript video explanation of the day.