about summary refs log tree commit diff
path: root/aoc/2021/07/part-one.raku
blob: 81cb7d422e0b3b4d40a6b052eb900eb44c67720f (plain) (blame)
1
2
3
my @input = map +*, split ',', trim slurp 'input';
sub cost($align) { [+] map { abs $align - $_ }, @input }
put min (cost $_ for (min @input)...(max @input))