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

10
2020/day10/day10.dyalog Normal file
View file

@ -0,0 +1,10 @@
⎕IO←0 ⋄ ⎕PP←15
p←⍎¨⊃⎕NGET'input'1
p←0,p[⍋p],3+⌈/p
×/⊢∘≢⌸2-/p ⍝ Part 1
c←0,0,1,(⌈/p)0 ⍝ paths counts
{c[⍵+2]←+/c[⍵+¯1 0 1]}¨1↓p
⊃⌽c ⍝ Part 2
a←(0∘<∧≤∘3)∘.-⍨p ⍝ adjacency matrix
+/{⊃⊖({a+.×⍵}⍣⍵)a}¨p ⍝ Part 2, the matrix way