about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--day2428
-rw-r--r--day24.k15
-rw-r--r--day24.k58
3 files changed, 51 insertions, 0 deletions
diff --git a/day24 b/day24
new file mode 100644
index 0000000..e204f7d
--- /dev/null
+++ b/day24
@@ -0,0 +1,28 @@
+1
+3
+5
+11
+13
+17
+19
+23
+29
+31
+37
+41
+43
+47
+53
+59
+67
+71
+73
+79
+83
+89
+97
+101
+103
+107
+109
+113
diff --git a/day24.k b/day24.k
new file mode 100644
index 0000000..3bc50bc
--- /dev/null
+++ b/day24.k
@@ -0,0 +1,15 @@
+d:0$'0:"day24";
+
+/ n:3;
+n:4;
+
+/ stupid eager brute forcing
+r:{b::n#0; p:: (n;0)#(); { p[*<b],:x; b[*<b]+:x }'x; :[b~n#(+/d)%n; p; ()]};
+
+s:{x::();
+ while[x~();x::r[d@(-#d)?#d]];
+ m::m& */x@*<#:'x;
+ `0:($m),"\n";};
+
+m:0I;
+while[1;s[]];
diff --git a/day24.k5 b/day24.k5
new file mode 100644
index 0000000..0a3ea6f
--- /dev/null
+++ b/day24.k5
@@ -0,0 +1,8 @@
+/ use ok
+
+n:4
+d:{x@>x}@.:'-1_0:"day24"
+g:(+/d)%n
+r:{`0:,$#x; $[6<#x; (); g=t:+/x; ,x; (t<g)&(0<#y); ,/{[v]r[x,*v;1_v]}'(!#y)_\:y; ()]}
+s:r[(); d]
+&/*/'s