blob: d48acff3f885bf4288e1b2a785d4dea7b90349c4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
:import std/Math .
:import std/String .
part1 [{ [[(1 <? 0) (+1) (+0)]] | 0 , ~0 }]
part2 [{ [[(1 <? 0) (+1) (+0)]] | 0 , ~(~(~0)) }]
main [parts nums]
nums number! <$> (lines 0)
parts [∑(part1 0) : ∑(part2 0)]
# equivalent alternative using std/Pair P
# part1 [length (filter (P.uncurry …<?…) (zip 0 ~0))]
# part2 [length (filter (P.uncurry …<?…) (zip 0 ~(~(~0))))]
|