(ns aocclj.day01 (:require [clojure.string :as str])) (defn preprocess [input] (sequence (comp (map parse-long) (partition-by nil?) (take-nth 2) (map (partial reduce +))) input)) (defn part1 [input] (reduce max (preprocess input))) (defn part2 [input] (->> input preprocess (sort >) (take 3) (reduce +)))