Advent of code in Rust - solving year 2020 exercise 14 - Part 2 (Twitch Live 2021-07-05)
In this episode, we completed Advent of Code y2020 ex14 part 2 (part 1 is available in the previous session ➡️ https://www.youtube.com/watch?v=thcdDUKE4Lw).
This exercise is basically a simulation of a simple calculator that can allocate memory and apply some sort of bit-masking algorithm to change the values in memory. We needed to run a given script as input and see what was the final configuration of the memory (output).
The second part requires a bit more work on calculating masks. We figured out how to do that and took some extra time to refactor our solution and generalise the approach a little bit.
We also showed some improvements we did to reduce the number of allocations from our original solution for part 1 (PR with diff here: https://github.com/lmammino/rust-advent/pull/10/files)
Feel free to send us more PRs if you want to recommend us to use a different approach! We are here to learn and we'd be happy to receive more and more suggestions :)
For all the source code check out the official GitHub repo: https://github.com/lmammino/rust-advent
For seeing the next episodes live check out our Twitch channel: https://twitch.tv/loige