From cf4eb886263e1c25953b3403c73ea20d8630db58 Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Thu, 24 Dec 2020 09:16:24 +0000 Subject: [PATCH] =?UTF-8?q?Day=2024=20part=202=20slicker=20with=20?= =?UTF-8?q?=E2=8D=B8=E2=8D=A3=C2=AF1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- p24.dyalog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p24.dyalog b/p24.dyalog index 8fa8c80..e329a82 100644 --- a/p24.dyalog +++ b/p24.dyalog @@ -3,4 +3,4 @@ p←{⊃+/⍎¨'[ns]?.'⎕S'&'⊢⍵}¨⊃⎕NGET'p24.txt'1 +/2|{≢⍵}⌸p ⍝ part 1 A←3 3⍴1 1 0 1 0 1 0 1 1 f←{2=n+⍵∧1=n←{+/,A×⍵}⌺3 3⊢⍵}{0⍪0⍪⍨0,0,⍨⍵} -+/,f⍣100{a←0⍴⍨⊃⌈/⍵ ⋄ a[⍵]+←1 ⋄ 2|a}1+p-⌊/p ⍝ part 2 ++/,f⍣100⊢2|⍸⍣¯1{(⊂⍋⍵)⌷⍵}1+p-⌊/p ⍝ part 2