AoC Day 2: Inventory Management System

rpalo

Ryan Palo

Posted on December 2, 2018

AoC Day 2: Inventory Management System

OK, the first day was awesome, I'm super excited about all of the solutions people posted. And I'm learning a lot! We've got a solid 20 people on the DEV leaderboard, which means there are still spots for 180 more -- use code 224198-25048a19 to join!

On to Day 2!


Day 2 of Advent of Code, and I'm pretty sure that Google is tired of me asking it questions every 15 seconds about "How Do I Do X in Rust."

Today's challenge involves an inventory system. Boxes have IDs that are a jumble of letters, and we've got a warehouse full of boxes to check. The first part asks us to analyze the frequency of letters in each ID. The second part gets into Hamming Distances, which are a familiar sight after mentoring on Exercism.

I got both parts working, and even part 2 ran pretty fast, but I'm not algorithmically happy with the double-loop (O(n^2)) runtime. Did anybody come up with anything tricky to do it more efficiently?

I'm going to post my solution in the comments like the rest of the cool kids.

How'd everybody else do?

💖 💪 🙅 🚩
rpalo
Ryan Palo

Posted on December 2, 2018

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Fart.js- The end of the world
javascript Fart.js- The end of the world

August 3, 2021

Advent of Code Wrap-Up
adventofcode Advent of Code Wrap-Up

December 25, 2018

AoC Day 24: Immune System Simulator 20XX
adventofcode AoC Day 24: Immune System Simulator 20XX

December 24, 2018

AoC Day 25: Four-Dimensional Adventure
adventofcode AoC Day 25: Four-Dimensional Adventure

December 25, 2018