aboutsummaryrefslogtreecommitdiff
path: root/advent-of-code/2022/01/1.rkt
blob: e8d1f2345237105f923f131e57bd71acdaf04eab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#lang racket

(require "../../lib/utils.rkt")

(define lines
  (call-with-input-file "input"
    (λ (fp)
      (get-lines fp))))

(define elves (split-list-by "" lines))

(define (elf-sum elf)
  (apply + (map string->number elf)))

(apply max (map elf-sum elves))