Full solution for today (spoilers!).
You are given a series of locks and keys (see below). How many unique
(lock, key)
are there that do not overlap (they do not have to fit perfectly).A lock starts from the top. The entire top row is
#
and the entire bottom row is.
.##### .#### .#### .#### .#.#. .#... .....
A key is the opposite:
..... ..... ..... #.... #.#.. #.#.# #####
Full solution for today (spoilers!).
Given a collection of gates of the form
arg0 (AND|OR|XOR) arg2 -> out
and input values of formx**
andy**
, what is the value ofz**
interpreted as a binary number?
Full solution for today (spoilers!).
You are given the edges of an undirected graph. Count how many complete subgraphs of size three exist that contain one or more starting with the letter
t
.
Aside: Games with local (but not hotseat) multiplayer have gotten rather rarer over the years… how many people still know what a LAN party is/was?
Full solution for today (spoilers!).
Implement a PRNG with the following update function:
- Multiply by 64, xor with the previous value, modulo 16777216
- Divide by 32, xor with the previous value (from step 1), modulo 16777216
- Multiply by 2048, xor with the previous value (from step 2), module 16777216
For each of a series of seeds, sum the 2000th generated number.
Full solution for today (spoilers!).
You are trying to type a code on a keypad:
+---+---+---+ | 7 | 8 | 9 | +---+---+---+ | 4 | 5 | 6 | +---+---+---+ | 1 | 2 | 3 | +---+---+---+ | 0 | A | +---+---+
But you cannot type directly. Instead, you can control a pointer on the keypad with arrow keys:
+---+---+ | ^ | A | +---+---+---+ | < | v | > | +---+---+---+
Whenever you type a
^
on the arrow keys, the pointer on the keypad will move up one, etc. When you typeA
, then the pointer on the keypad will type whatever it is pointing at.But that’s not enough either. Add a second keypad. And then a third, that is the one you are actually controlling.
For each output sequence multiple the length of the minimum input sequence needed to generate it by the numeric value of the input sequence (ignoring any
A
); sum these.Note: Moving off any keypad or into the blank spaces is an error.
Full solution for today (spoilers!).
Given a maze with exactly one path, find how many single walls you can walk through (remove) that shorten the best path by at least 100 units.
Full solution for today (spoilers!).
Given a comma delimited list of substrings and a list of strings, count how many of the latter strings can be made up of any (repeating) combination of the former.
Full solution for today (spoilers!).
You are given a series of points on a
71x71
grid. Taking only the first 1024 points, how long is the shortest path from(0, 0)
to(70, 70)
?
Full solution for today (spoilers!).
Implement a virtual machine. The machine will have 3 unbounded signed registers, 8 opcodes (see below), a variable parameter scheme (see below that). You will be given the initial values of the 3 registers and a program. Find the final output.
Opcode | Instruction | Description | Notes |
---|---|---|---|
0 | adv reg/val | A = A >> OP | |
1 | bxl val | B = B ^ OP | |
2 | bst reg/val | B = OP & 0b111 | |
3 | jnz val | If a =/= 0 , jump to LIT | |
4 | bxc ignore | B = B ^ C | Still takes param, but ignores it |
5 | out reg/val | Output b | Only outputs lowest 3 bits |
6 | bdv reg/val | B = A >> OP | Same as adv but writes to b |
7 | cdv reg/val | C = A >> OP | Same as adv but writes to c |
For instructions that can take reg/val
, 0
to 3
(inclusive) are treated as literal values, 4
is register A
, 5
is B
, 6
, is C
, and 7
is an error (should never happen).
For instructions that only take val
, it’s always a literal value in the range 0
to 7
(inclusive).