diff --git a/2024/day08/day08.bqn b/2024/day08/day08.bqn new file mode 100644 index 0000000..5b734a5 --- /dev/null +++ b/2024/day08/day08.bqn @@ -0,0 +1,7 @@ +in←>•FLines"input" +n←≠in +freqs←∾"0aA"+¨↕¨10‿26‿26 +as←∾{(≠⌜˜↕∘≠)⊸(/○⥊)(⊣+-)⌜˜/○⥊⟜(↕≢)𝕩=in}¨freqs +•Show ≠⍷(∧´¨0⊸≤∧<⟜n¨¨)⊸/as +as2←∾{∾(≠⌜˜↕∘≠)⊸(/○⥊){(<𝕩)+(<𝕩-𝕨)×↕n}⌜˜/○⥊⟜(↕≢)𝕩=in}¨freqs +•Show ≠⍷(∧´¨0⊸≤∧<⟜n¨¨)⊸/as2 diff --git a/2024/day08/input b/2024/day08/input new file mode 100644 index 0000000..43b8c92 --- /dev/null +++ b/2024/day08/input @@ -0,0 +1,50 @@ +........5..................................e..3... +.......q...........m................e............. +....m.......................................e..... +.........................................C........ +.u.m........................8..................... +...........7......9.......8...........F...s....... +6...q..............................s.............. +.................................................. +.................................................. +.................................................. +..........9....................F.................. +.................................M....D........... +.........U........................................ +..q................................8.............. +.......9.......................................... +0....6.....................e..Qs...............F.. +.................................Q...D............ +.0.u....................................2......... +.................................................. +........u................Q........................ +.....E........1................................... +...n....v....................................3.... +......u..0................N....................... +............................................z..... +.........7....U.........4.....Z...Q.....D.....V... +..............n1.........f.................2...... +E.............................f..............z.... +...E........1.Z.......U......................D.... +.......n...v....7Z...N............................ +..........7..N.....Zf...........................3. +................................b............V.... +............4..................................9.. +..n...v........................5................2. +.........v.................5.........S............ +..........................s....................... +.....U.........4..C.....................S..V...... +.................................................. +......................c........b............M..... +...........4.Wc....d.......1.....b.....S.......... +..E........c............................5......z.. +..............w..C....................SM.2........ +........................d......................... +...............c......C3.......................... +...............w....W............................. +.................................................. +.........d.......B....w........................... +....B.....W.......dw..........................M... +...............W......................N...V....... +.B................................................ +....................B...............b............. diff --git a/2024/day08/test b/2024/day08/test new file mode 100644 index 0000000..78a1e91 --- /dev/null +++ b/2024/day08/test @@ -0,0 +1,12 @@ +............ +........0... +.....0...... +.......0.... +....0....... +......A..... +............ +............ +........A... +.........A.. +............ +............