Author: | jonenst |
---|---|
Mode: | factor |
Date: | Tue, 7 Dec 2021 09:06:02 |
: 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 ;