Paste: aoc7

Author: jonenst
Mode: factor
Date: Tue, 7 Dec 2021 09:06:02
Plain Text |
: day7 ( -- )
    "/tmp/input" ascii file-lines first "," split
    [ string>number ] map
    [ dup median [ - abs ] curry map-sum . ]
    [ dup mean [ floor ] [ ceiling ] bi
      [ [ - abs dup 1 + * 2 / ] curry map-sum ]
      bi-curry@ bi min .
    ] bi ;

New Annotation

Summary:
Author:
Mode:
Body: