Advent Of Code

Advent Of Code 2015, Day 14: Flying Reindeers

Reindeers Olympics is the theme of day 14. As we all know from high-school biology lessons, reindeers can fly at high speeds but they need to rest from time to time to recover their energy level. This makes reindeer racing a bit complicated but q can deal with it anyway! Winning Distance In the first… Continue reading Advent Of Code 2015, Day 14: Flying Reindeers

Advent Of Code

Advent Of Code 2015, Day 13: Cutting Down On Permutations

Day 13 is very similar to day 9, just this time we are looking for the optimal seating arrangement around a Christmas table. Both puzzles are very similar but they have slightly different properties which means... we only need a subset of permutations to solve today's one. Getting the arrangements For day 9 we had… Continue reading Advent Of Code 2015, Day 13: Cutting Down On Permutations

Advent Of Code

Advent Of Code 2015, Day 12: Cheeky Match

Day 12 brings us a rather simple challenge. We need to sum all numbers in Santa's JSON file. We can be a bit cheeky here and simply use = together with each-left to find all digits. After partitioning the string by "," and casting the output to long, we get all available numbers: "J"$"," vs… Continue reading Advent Of Code 2015, Day 12: Cheeky Match

Advent Of Code

Advent Of Code 2015, Day 11: Getting Valid Passwords

Even Santa must change his password from time to time. Unfortunately, this time he needs our help because his new Security-Elf imposed some additional password requirements. A new password should be generated using Santa's incremental method and then validated to ensure it is not breaking any safety rules. Generating Passwords The first step to get… Continue reading Advent Of Code 2015, Day 11: Getting Valid Passwords

Advent Of Code

Advent Of Code 2015, Day 10: Look-And-Say

Have you ever heard about the look-and-say sequence? Me neither but that is what Santa's elves are playing on day 10 and what our coding challenge is about. We are given an input number and we need to find out the number of digits in the 40th and 50th value of the sequence. Look-and-say sequences… Continue reading Advent Of Code 2015, Day 10: Look-And-Say

Advent Of Code

Advent Of Code 2015, Day 9: Over Permutations

This time we need to help Santa with his delivery route. He wants to know the shortest and the longest distance he can travel. He can start and end at any two different locations but each location can be visited only once. Obviously, we need to generate all the possible routes (permutations!) which already makes… Continue reading Advent Of Code 2015, Day 9: Over Permutations

Advent Of Code

Advent Of Code 2015, Day 8: Let’s ssr Over

Day 8th is all about strings and the number of characters. Basically, we want to know the difference between the number of characters in the code representation of the string literal and the number of characters in the in-memory string itself. For example, "" has 2 characters of code (the two double quotes) but the string itself is… Continue reading Advent Of Code 2015, Day 8: Let’s ssr Over