From 6f6aa608a147dbec963225b1f3dcd19a06eb00be Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Sat, 2 Oct 2021 00:08:11 +0200 Subject: Problem 79 --- problem79.ijs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 problem79.ijs diff --git a/problem79.ijs b/problem79.ijs new file mode 100644 index 0000000..58ffe63 --- /dev/null +++ b/problem79.ijs @@ -0,0 +1,25 @@ +notBlocked =: {{ + first =. x={.y + notThere =. -.x e. y + first +. notThere +}} + +nextChar =: {{ + *./;x notBlocked each y +}}"0 1 + +solve =: {{ + result =. '' + data =. 'b' fread 'p079_keylog.txt' + chars =. ~.;data + while. 0<#chars do. + ch =. {.chars{~I. chars nextChar data + result =. result,ch + removeCh =. ch&(~:#]) + chars =. removeCh chars + data =. removeCh each data + end. + result +}} + +problem79 =: solve '' -- cgit v1.2.3