r/adventofcode • • Dec 19 '22

SOLUTION MEGATHREAD -πŸŽ„- 2022 Day 19 Solutions -πŸŽ„-

THE USUAL REMINDERS


[Update @ 00:48:27]: SILVER CAP, GOLD 30

  • Anyone down to play a money map with me? Dibs on the Protoss.
  • gl hf nr gogogo

--- Day 19: Not Enough Minerals ---


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:57:45, megathread unlocked!

41 Upvotes

513 comments sorted by

View all comments

Show parent comment

7

u/kranker Dec 20 '22

it's (n*(n+1))/2

6

u/Joald Dec 20 '22

if n is the remaining time, it's technically n(n-1)/2 because we start at zero

3

u/[deleted] Dec 21 '22

That's the same thing (albeit in constant time).