Quick actions

cmd+k|ctrl+k

Navigation

Languages

AoC2024, day 1

Snippet info

Language

Raku

Visibility

public

Author

seaker

Created

2024-12-01T06:12:23.566077Z

Updated

2024-12-03T02:08:21.822117Z

# https://adventofcode.com/2024/day/1

my ($L, $R) = (.[*;0], .[*;1]).map(*.sort.Array) with $*IN.lines».words;
put 'part 1: ', ($L «-« $R)».abs.sum;
put 'part 2: ', $L.map({ $_ * $R.Bag{$_} }).sum;
INFO