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.
Part 1: Take the assembunny interpreter from day 12 and add one new instruction (out
x
) which transmits the valuex
(either an integer or register). Find the lowest value we can initializea
to so that theout
put signals form an infinite repeating pattern of0
,1
,0
,1
, …
Part 1: Given a map of the form:
########### #0.1…..2# #.#######.# #4…….3# ###########
Part 1: Take the assembunny interpreter from day 12 and add an instruction (tgl
X
) that modifies the code at an offset ofX
instructions.
inc
becomesdec
; any other one argument instruction (includingtgl
) becomesinc
jnz
becomescpy
; any other two argument instructions becomejnz
- Toggling an instruction outside of the program does nothing (it does not halt execution)
- If toggling produces an invalid instruction, ignore it
Run the given program with the initial register of
a = 7
. What is the final value in registera
?