To ensure security, a valid passphrase must contain no duplicate words.
For example:
The system's full passphrase list is available as your puzzle input. How many passphrases are valid?
In [1]:
from notebook_preamble import J, V, define
I'll assume the input is a Joy sequence of sequences of integers.
[[5 1 9 5]
[7 5 4 3]
[2 4 6 8]]
So, obviously, the initial form will be a step
function:
AoC2017.4 == 0 swap [F +] step
F == [size] [unique size] cleave =
The step_zero
combinator includes the 0 swap
that would normally open one of these definitions:
In [2]:
J('[step_zero] help')
AoC2017.4 == [F +] step_zero
In [3]:
define('AoC2017.4 == [[size] [unique size] cleave = +] step_zero')
In [4]:
J('''
[[5 1 9 5]
[7 5 4 3]
[2 4 6 8]] AoC2017.4
''')