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 (1427B)


      1--- Part Two ---
      2
      3Maybe a fancy trick shot isn't the best idea; after all, you only have one probe, so you had better
      4not miss.
      5
      6To get the best idea of what your options are for launching the probe, you need to find
      7every initial velocity that causes the probe to eventually be within the target area after any step.
      8
      9In the above example, there are 112 different initial velocity values that meet these criteria:
     10
     1123,-10  25,-9   27,-5   29,-6   22,-6   21,-7   9,0     27,-7   24,-5
     1225,-7   26,-6   25,-5   6,8     11,-2   20,-5   29,-10  6,3     28,-7
     138,0     30,-6   29,-8   20,-10  6,7     6,4     6,1     14,-4   21,-6
     1426,-10  7,-1    7,7     8,-1    21,-9   6,2     20,-7   30,-10  14,-3
     1520,-8   13,-2   7,3     28,-8   29,-9   15,-3   22,-5   26,-8   25,-8
     1625,-6   15,-4   9,-2    15,-2   12,-2   28,-9   12,-3   24,-6   23,-7
     1725,-10  7,8     11,-3   26,-7   7,1     23,-9   6,0     22,-10  27,-6
     188,1     22,-8   13,-4   7,6     28,-6   11,-4   12,-4   26,-9   7,4
     1924,-10  23,-8   30,-8   7,0     9,-1    10,-1   26,-5   22,-9   6,5
     207,5     23,-6   28,-10  10,-2   11,-1   20,-9   14,-2   29,-7   13,-3
     2123,-5   24,-8   27,-9   30,-7   28,-5   21,-10  7,9     6,6     21,-5
     2227,-10  7,2     30,-9   21,-8   22,-7   24,-9   20,-6   6,9     29,-5
     238,-2    27,-8   30,-5   24,-7
     24
     25How many distinct initial velocity values cause the probe to be within the target area after any
     26step?
     27
     28