aoc-2020-zig

Advent of Code 2020 Solutions in Zig
git clone https://git.sinitax.com/sinitax/aoc-2020-zig
Log | Files | Refs | README | sfeed.txt

part2 (1457B)


      1--- Part Two ---
      2
      3Due to what you can only assume is a mistranslation (you're not exactly fluent in Crab), you are
      4quite surprised when the crab starts arranging many cups in a circle on your raft -
      5one million (1000000) in total.
      6
      7Your labeling is still correct for the first few cups; after that, the remaining cups are just
      8numbered in an increasing fashion starting from the number after the highest number in your list and
      9proceeding one by one until one million is reached. (For example, if your labeling were 54321, the
     10cups would be numbered 5, 4, 3, 2, 1, and then start counting up from 6 until one million is
     11reached.) In this way, every number from one through one million is used exactly once.
     12
     13After discovering where you made the mistake in translating Crab Numbers, you realize the small crab
     14isn't going to do merely 100 moves; the crab is going to do ten million (10000000)
     15moves!
     16
     17The crab is going to hide your stars - one each - under the two cups that will
     18end up immediately clockwise of cup 1. You can have them if you predict what the labels on those
     19cups will be when the crab is finished.
     20
     21In the above example (389125467), this would be 934001 and then 159792; multiplying these together
     22produces 149245887792.
     23
     24Determine which two cups will end up immediately clockwise of cup 1. What do you get if you
     25multiply their labels together?
     26
     27