aboutsummaryrefslogtreecommitdiffhomepage
path: root/samples/aoc/2022/01/solve.bruijn
blob: 7b2eaf64862a5924861b282f8a6189ef7325c4ba (plain) (blame)
1
2
3
4
5
6
7
8
9
:import std/Math .
:import std/String .

main [answer]
	numbers string→number <$> (lines 0)
	parts split-list-by =?‣ numbers
	sums sum <$> parts
	answer build (sort-desc sums)
		build [^0 : ∑(take (+3) 0)]