-
-
Save jcmorrow/d95113066f69ffb1a69de4b63f03e900 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nums =: ".S:0 (LF cut fread '~/code/advent_of_code/day_9.txt') | |
valid =: monad : '(_1 {. (y { nums)) e. ~.,((_1 }. (y { nums)) +/ (_1 }. (y { nums)))' | |
iter =: dyad : '(i.(#x)-(y-1)) +/ (i.y)' | |
goal =: (((,valid &> <"1(_25 }. ,.nums iter 26)) i. 0) + 25) { nums | |
get =: monad : 'y { nums' | |
index =: (+/ "1 get &> <"1 (_1}. nums iter 17)) i. goal | |
(<./ (index { nums iter 17) { nums) + (>./ (index { nums iter 17) { nums) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment