Add day 3 solution in J.

This commit is contained in:
Danila Fedorin 2020-12-23 21:46:46 -08:00
parent 34cb639327
commit ee819d1362
1 changed files with 5 additions and 0 deletions

5
day3.ijs Normal file
View File

@ -0,0 +1,5 @@
r =: > cutopen 1!:1 < jpath '~/projects/AoC/2020/year2020day3.txt.cache'
rn =: 4 : '+/''#''=((#|:y)|x*i.#y){"0 1 y'
rnx =: 3 : '(1{y) rn 0{"2((0{-y)]\r)'
rnx 1 3
*/ rnx"1 (_2 [\ 1 1 1 3 1 5 1 7 2 1)