aoc-2021-rust

Advent of Code 2021 Solutions in Rust
git clone https://git.sinitax.com/sinitax/aoc-2021-rust
Log | Files | Refs | README | sfeed.txt

part2 (1171B)


      1--- Part Two ---
      2
      3Now that you're warmed up, it's time to play the real game.
      4
      5A second compartment opens, this time labeled Dirac dice. Out of it falls a single three-sided die.
      6
      7As you experiment with the die, you feel a little strange. An informational brochure in the
      8compartment explains that this is a quantum die: when you roll it, the universe splits into multiple
      9copies, one copy for each possible outcome of the die. In this case, rolling the die always splits
     10the universe into three copies: one where the outcome of the roll was 1, one where it was 2, and one
     11where it was 3.
     12
     13The game is played the same as before, although to prevent things from getting too far out of hand,
     14the game now ends when either player's score reaches at least 21.
     15
     16Using the same starting positions as in the example above, player 1 wins in
     17444356092776315 universes, while player 2 merely wins in 341960390180808 universes.
     18
     19Using your given starting positions, determine every possible outcome. Find the player that wins in
     20more universes; in how many universes does that player win?
     21
     22