diff options
author | Leah Neukirchen <leah@vuxu.org> | 2020-12-03 15:25:35 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2020-12-03 15:25:35 +0100 |
commit | a804cd7bdf6cf1557cca4656eeca678925059358 (patch) | |
tree | 0ca179dddcb2c9a4d2a38c1a74c3c92b9161b1db /day02.ijs | |
parent | 4fcb892b97f7bbdba4c2a873e4493a00722ef40e (diff) | |
download | adventofcode2020-a804cd7bdf6cf1557cca4656eeca678925059358.tar.gz adventofcode2020-a804cd7bdf6cf1557cca4656eeca678925059358.tar.xz adventofcode2020-a804cd7bdf6cf1557cca4656eeca678925059358.zip |
day02
Diffstat (limited to 'day02.ijs')
-rw-r--r-- | day02.ijs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/day02.ijs b/day02.ijs new file mode 100644 index 0000000..3faeed7 --- /dev/null +++ b/day02.ijs @@ -0,0 +1,16 @@ +load 'aoc.ijs' +d =: lines 'day02' + +part1=: 3 : 0 +'a b c d' =. chopstring '- ' stringreplace y +(-: /:~) (".a),(+/d={.c),(".b) +) + ++/ part1@> d NB. 586 + +part2=: 3 : 0 +'a b c d' =. chopstring '- ' stringreplace y +1=+/ ((<: (". a),(".b)) { d) = {.c +) + ++/ part2@> d NB. 352 |