commit e97353b1c5f8e6e25c383ade83b9af6fd39c6ea6
parent 791aea99bcdf304b74c47039e1283c87738eb5d9
Author: mpizzzle <m@michaelpercival.xyz>
Date: Mon, 6 Dec 2021 23:56:03 +0000
minor cleanup of puzzle 2 part 1 (still needs optimizing)
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/2021/puzzle_2.apl b/2021/puzzle_2.apl
@@ -2,7 +2,7 @@
input← ⎕FIO[49] 'files/2.txt'
-c← {↑ ↑ (+/⍤ 1) ⍺ {9 ↑ (⍺ = ⍵ ) × (⍎⍵ [(⍴ ⍵ )]) } ¨ ⍵ }
+c← { +/⍺ { 1 ⍴ (⍺ = ⍵) × ⍎⍵[⍴ ⍵] } ¨ ⍵ }
('f' c input) × (('d' c input) - ('u' c input)) ⍝ part 1
)OFF