aboutsummaryrefslogtreecommitdiff
path: root/day11.k
blob: bff5ad56d01376a997a2a67e4e44a39bef0b4fa1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
d: "hepxcrrq";

abc: _ci' (_ic "a") + !26;

inc:{abc @ 26 _vs 1+26 _sv abc ?/: x}; / broken with leading "a"...

infix:{:[y>#x;,x;x@(!y)+/:!(1-y)+#x]};

r1:{|/ {(!3)~x-*x}' infix[abc ?/: x; 3]};
r2:{~|/ (#x)> x ?/: "iol"};
r3:{1<#?x@&=':x};

p1: (inc)/[{~(r1 x)&(r2 x)&(r3 x)};d]
p2: (inc)/[{~(r1 x)&(r2 x)&(r3 x)};inc p1]