And so closes out the first week. Can you believe we're already 20% of the way through the challenge? How's everybody doing staying on top of it? I was in awe of some of the solutions I saw yesterday. And I believe we had another couple firsts for new languages. Anyways, to the puzzle:
The Puzzle
In today’s puzzle, we've lost our boarding pass. But, like any tech-savvy holiday traveler, we're writing a program to use binary partitioning to unravel strings like BFBFFFBLRL into seat ID's. So. Yeah. Good luck!
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 03:07PM 12/12/2020 PST.
Language | Count |
---|---|
JavaScript | 4 |
Ruby | 2 |
C | 2 |
PHP | 2 |
Rust | 2 |
Python | 2 |
C# | 1 |
Go | 1 |
COBOL | 1 |
TypeScript | 1 |
Elixir | 1 |
Haskell | 1 |
Merry Coding!
Latest comments (28)
My Haskell Solution (I just started learning Haskell so fair warning):
Haskell:
My solution in python. Sometimes the challenge is just clicking what the description is actually saying, once it's obvious that these are just binary numbers then it was quite an easy one.
Hi, new to this site, and AOC. I did the last 4 in Python, but I thought I would try shell for this one (i'm not great at shell so this may be not the best):
I solved part 1 with this shell oneliner...
for part two, I created the list of passport ids with:
then threw this at the ids file:
My JavaScript walkthrough:
Ruby, Late to the party - catching up!
I see lots of complex solutions when binary data packing/unpacking should be relatively compact and optimized. Hopefully this helps give people some ideas!
Part 2 of the puzzle was really puzzling, though I got the answer using set theory
Ruby, part 2:
Today I have two implementations in Ruby for ya.
Here's my C implementation. Kind of glad it was a straightforward problem this time. Will do tomorrow's in Python.