2024 day 8
This commit is contained in:
parent
7dc480d68f
commit
54a991f4f2
3 changed files with 69 additions and 0 deletions
7
2024/day08/day08.bqn
Normal file
7
2024/day08/day08.bqn
Normal file
|
@ -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
|
50
2024/day08/input
Normal file
50
2024/day08/input
Normal file
|
@ -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.............
|
12
2024/day08/test
Normal file
12
2024/day08/test
Normal file
|
@ -0,0 +1,12 @@
|
|||
............
|
||||
........0...
|
||||
.....0......
|
||||
.......0....
|
||||
....0.......
|
||||
......A.....
|
||||
............
|
||||
............
|
||||
........A...
|
||||
.........A..
|
||||
............
|
||||
............
|
Loading…
Add table
Add a link
Reference in a new issue