Last active
December 2, 2021 09:27
-
-
Save xpqz/6e05b8fc54a6aa1876d32d5b18632ea5 to your computer and use it in GitHub Desktop.
Advent of Code 2021, ngn/k
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
/ day 1 | |
d:`I$0:"../d/1" | |
+/>':d | |
+/(-3_d)<3_d / no need to sum the 3-window | |
/ day 2 | |
d:" "\'d:0:"../d/2" | |
mag:`I$d[;1];dir:d[;0] | |
m:(("forward";"down";"up")~/:\:dir)*\:mag | |
s:+/'m;s[0]*s[1]-s[2] | |
(+/(-/+\'1_m)*m@0)*+/m@0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment