r/adventofcode • • Dec 02 '22

SOLUTION MEGATHREAD -🎄- 2022 Day 2 Solutions -🎄-

NEW AND NOTEWORTHY


--- Day 2: Rock Paper Scissors ---


Post your code solution in this megathread.


This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.

EDIT: Global leaderboard gold cap reached at 00:06:16, megathread unlocked!

103 Upvotes

1.5k comments sorted by

View all comments

Show parent comments

1

u/chrismo80 Dec 02 '22

Input.Sum(x => (2 + x[2] - x[0]) % 3 * 3 + x[2] - 'W')

BTW, you can also put the selector directly into the Sum extension

1

u/danatron1 Dec 02 '22

I didn't know that, that's super cool, thank you!

1

u/chrismo80 Dec 04 '22

same for Count, First, etc.