cjc.im / posts / Advent of Code Days 2-4

Not going to post code here as it would be horrible anyway, I am taking the approach of getting it done and not worry about maintainability of code.

Day 2 part one was just number manipulation to create a "checksum" pretty simple, didn't take long. Part 2 introduced a little change that required you to deal with the only 2 numbers that divide into each other. Again, nothing too serious.

Day 3 was a bit of a difficult one, part one took a while as it was dealing with a sprial of numbers on a grid with the aim to find the Manhatten Distance to the centre. Took a while but I got it by calculating the distance rather than mapping the spiral. This backfired as part 2 seems to require the spiral, so I left this for now.

Day 4 in contrast to 3 was easy, passphrase "validation", part one there can be no duplicated words in a passphrase. Simple. 5 minutes with python. Part two introduced the complexity of no words can be anagrams of others. Another 5 minutes, done.

Probably have a stab at 3 again if I get time.

Tags: development