I was pretty busy this weekend so I didn’t have time to do the problems. I started on problem 15 but realized it would take me a lot of time, so I decided to go ahead and complete problems 16 and 17 and come back to 15 later.

For problem 16, I created a simple Processor class that contains registers and can execute an operation. To solve the first part, I looped through each operation and counted the number of times the registers matched for each test. The input is small enough that it’s not a problem.

For the second part of the problem, I looped through each test, fixing the mapping between the opcode and the operation until all opcodes were found. After that, I executed each operation on the processor and returned the value of the first register.