Back to index
/
Generated with
Clerk
from
src/advent_of_clerk/day_01.clj@
876b9bb
🎄 Advent of Clerk: Day 1
(
ns
advent-of-clerk.day-01
(
:require
[clojure.java.io
:as
io]
[clojure.string
:as
str]
[nextjournal.clerk
:as
clerk]))
(
def
input
(
slurp
(
io/resource
"
day_1.txt
"
)))
"
62797
↩︎
↩︎
1137
↩︎
6086
↩︎
6104
↩︎
1895
↩︎
7909
↩︎
1651
↩︎
4973
↩︎
6964
↩︎
5989
↩︎
6003
↩︎
6859
↩︎
↩︎
2817
↩︎
3841
↩︎
5360
↩︎
26
10359 more elided
"
(
->>
(
str/split-lines
input)
(
partition-by
str/blank?)
(
filterv
#(
not=
% [
"
"
]))
(
mapv
(
fn
[xs] (
mapv
#(
Integer/parseInt
%) xs)))
(
map
#(
reduce
+ %))
(
apply
max))
68442