LC 3850 - Count Sequences to K
To check whether it can become an integer k, we track prime-exponent vectors instead of doing fraction arithmetic. In this problem we only care about primes {2,3,5} since the number is 1 to 6. If k contains any other prime factor, it is impossible, return 0. Then we do the search backwards, process nums from right to left, and at each position, do unchanged, multiple or divide. When we finish all indices we add the total count by one if the remaining target is 1. ...