about summary refs log tree commit diff
path: root/day01.rkt
blob: 0576f02782f7ab827eab93a9867a4eb62e68e5ce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#lang racket

(define ordered-food
  (sort (for/list ([para (string-split (file->string "day01") "\n\n")])
          (for/sum ([line (string-split para "\n")])
            (string->number line)))
        >))

(first ordered-food)                    ; 67016
(apply + (take ordered-food 3))         ; 200116