r/codegolf • • 18h ago

Advent of Code 2026 Day 1

2 Upvotes

Did it in powershell

Part 1 (145 bytes): $b=1;(gcb|group|sort -Property Count|select -last 3).name|%{$b=$b*$_};$b

Part 2 (146 bytes): $b=1;(gcb|group|sort -Property Count|select -First 3).name|%{$b=$b*$_};$b

I feel like this isn't a really golfable approach. I might try again in Bash.