Advent of Code Day 8 - Treetop Tree House

Question The elves come to you with a problem, they want to build a tree house but they want to make sure that they have enough cover. We are given a map of the forest with a number representing each tree’s height. 1 2 3 4 5 30373 25512 65332 33549 35390 Parsing We care about the location of each tree and its height. All of the above is available to us if we parse our map into a matrix [][]int...

December 8, 2022 · 5 min · 1045 words · Gal Elmalah

Advent of Code Day 7 - No Space Left On Device

Question This was a fun day! we finally got something challenging. We got a device from the elves when trying to update that device we got an error that notifies us that there isn’t enough memory on our device 1 2 $ system-update --please --pretty-please-with-sugar-on-top Error: No space left on the device To determine what’s going on we start exploring the device file system and record the output (our puzzle input) For example...

December 8, 2022 · 7 min · 1488 words · Gal Elmalah

Advent of Code Day 6 - Tuning Trouble

Question Finally, we move out of camp! As we start heading out of the camp one of the elves gives us a communication device, it will come as no surprise that we got the only malfunctioning device… The device receives streams of signals that are built from a list of chars, to fix our device we need to be able to find the start-of-packet marker. Part 1 We are told that the start of the packet is defined as a series of four different consecutive chars....

December 5, 2022 · 5 min · 877 words · Gal Elmalah

Advent of Code Day 5 - Supply Stacks

Question Welcome to day 5 of AoC, aka, annoying AF parsing day. We are crane operators! What do we want?! More stacks and crates! Anyhow, we are charged to execute a series of delicate manuvers using our insane crane skills Our input is given to us as follows 1 2 3 4 5 6 7 8 9 [D] [N] [C] [Z] [M] [P] 1 2 3 move 1 from 2 to 1 move 3 from 1 to 3 move 2 from 2 to 1 move 1 from 1 to 2 The first half represents the current state of stacks and crates....

December 5, 2022 · 5 min · 952 words · Gal Elmalah