From 737989f1492b400d59a22a5235555b51a23181fa Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 3 Mar 2023 17:20:59 +0100 Subject: Added second part of aoc and needed functions Also, I don't know how I got 30s for the first part previously. Cannot reproduce and probably was a mistake. idk --- samples/aoc/2022/01/solve.bruijn | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'samples/aoc/2022/01/solve.bruijn') diff --git a/samples/aoc/2022/01/solve.bruijn b/samples/aoc/2022/01/solve.bruijn index 7764db8..94b4cf7 100644 --- a/samples/aoc/2022/01/solve.bruijn +++ b/samples/aoc/2022/01/solve.bruijn @@ -1,7 +1,9 @@ :import std/Math . :import std/String . -main [lmax sums] +main [answer] numbers number! <$> (lines 0) - parts split-at =?‣ numbers + parts split-list-by =?‣ numbers sums sum <$> parts + answer build (sort-desc sums) + build [^0 : ∑(take (+3) 0)] -- cgit v1.2.3