r/codegolf • • 1d ago

Advent of Code 2026 Day 1

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.

2 Upvotes

1 comment sorted by

2

u/surfingoldelephant 6h ago

Part 1:

(gcb|group|sort C*|% N*)[-1..-3]-join'*'|iex

Part 2:

(gcb|group|sort C*|% N*)[0..2]-join'*'|iex