Source: Memory Reallocation
Part 1: Start with
n
stacks of different sizes. Take the largest block and distribute its items starting withn+1
and looping around. How many iterations of this does it take before you see a state you’ve seen before?
Part 1: Start with
n
stacks of different sizes. Take the largest block and distribute its items starting withn+1
and looping around. How many iterations of this does it take before you see a state you’ve seen before?
Part 1: Interpret a program made entirely of jump instructions: each instruction is how many steps to jump. Any time you use an instruction to jump, increase the value of that jump by 1 for next time. How many total steps does it take to escape (jump out of bounds)?
Part 1: Given a list of passphrases, count how many contain no duplicate words.
Part 1: Create a grid in a spiral pattern like so:
17 16 15 14 13 18 5 4 3 12 19 6 1 2 11 20 7 8 9 10 21 22 23—> …
Part 1: The checksum of a list of numbers is the difference between the largest and smallest number in the row. What is the sum of checksums of a file containing many such lists?
Part 1: Given a number, what is the sum of pairs of digits that match (wrapping the last digit around to the first)?
As mentioned in the main post, I’m structuring my solutions a bit differently this year. Rather than repeating the same relatively lengthy header in each function, we’re going to have a few shared files that can be imported or used for every problem.