2024 day 2
This commit is contained in:
parent
b619d1244a
commit
86f2c69d03
3 changed files with 1012 additions and 0 deletions
6
2024/day02/day02.bqn
Normal file
6
2024/day02/day02.bqn
Normal file
|
@ -0,0 +1,6 @@
|
|||
in←•ParseFloat¨¨' '⊸((¬-˜⊢×·+`»⊸>)∘≠⊔⊢)¨•FLines"input"
|
||||
Sorted←∧⊸≡∨∨⊸≡
|
||||
Step←∧´∘(1⊸≤∧≤⟜3)(|1⊸(↓--⊸↓))
|
||||
•Show +´(Sorted∧Step)¨in
|
||||
Expand←{((∾↑⋈1⊸+⊸↓)⟜𝕩)¨(↕≠)𝕩}
|
||||
•Show +´∨´¨(Sorted∧Step)¨¨Expand¨in
|
1000
2024/day02/input
Normal file
1000
2024/day02/input
Normal file
File diff suppressed because it is too large
Load diff
6
2024/day02/test
Normal file
6
2024/day02/test
Normal file
|
@ -0,0 +1,6 @@
|
|||
7 6 4 2 1
|
||||
1 2 7 8 9
|
||||
9 7 6 2 1
|
||||
1 3 2 4 5
|
||||
8 6 4 4 1
|
||||
1 3 6 7 9
|
Loading…
Add table
Add a link
Reference in a new issue