Initial commit

This commit is contained in:
Dimitri Lozeve 2024-11-12 21:43:32 +01:00
commit f242d2b0df
420 changed files with 62521 additions and 0 deletions

6
2020/day09/day09.dyalog Normal file
View file

@ -0,0 +1,6 @@
⎕IO←0
p←⍎¨⊃⎕NGET'input'1
m←25
⊢x←p⌷⍨m+⍸~(m↓p)∊¨{(,∘.<⍨m)/,⍵}¨∘.+⍨¨¯1↓m,/p ⍝ Part 1
⍝+/∊{{(x=+/⍵)×(⌈/+⌊/)⍵}¨⍵,/p}¨2+p ⍝ Part 2
(⌈/+⌊/)p[{(1+1⊃⍵)+⍳⊃-/⍵}⊃⍸x=∘.-⍨+\p] ⍝ Part 2 (faster)