Initial commit
This commit is contained in:
commit
f242d2b0df
420 changed files with 62521 additions and 0 deletions
15
2023/day11/day11.bqn
Normal file
15
2023/day11/day11.bqn
Normal file
|
@ -0,0 +1,15 @@
|
|||
n‿m←≢input←'#'=>•FLines"input"
|
||||
pos←∾¨´m(⌊∘÷˜⋈|)/⥊input
|
||||
|
||||
dists←(+´∘|∘-)⌜˜pos
|
||||
|
||||
emptyRows←/(¬∨´˘)input
|
||||
emptyCols←/(¬∨´˘)⌾⍉input
|
||||
nempty←{x1‿y1𝕊x2‿y2:
|
||||
a←|-´emptyCols⍋y2‿y1
|
||||
b←|-´emptyRows⍋x2‿x1
|
||||
a+b
|
||||
}⌜˜pos
|
||||
|
||||
•Show 2÷˜+´⥊dists+nempty
|
||||
•Show 2÷˜+´⥊dists+999999×nempty
|
Loading…
Add table
Add a link
Reference in a new issue