summaryrefslogtreecommitdiff
path: root/problem79.ijs
diff options
context:
space:
mode:
Diffstat (limited to 'problem79.ijs')
-rw-r--r--problem79.ijs25
1 files changed, 25 insertions, 0 deletions
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 ''