2 ms·
That's correct. In practice it appears that the AoC inputs provide numbers which are always co-prime (ie have no common factors other than 1).
by tialaramex 3y ago
That's correct. In practice it appears that the AoC inputs provide numbers which are always co-prime (ie have no common factors other than 1).
- dunham 3y agoDo you know if there were any inputs on this problem that had non-prime numbers? Like others, I used LCM in my code, but mine were all prime numbers.
- tialaramex 3y agoI don't know, presumably Topaz (who creates AoC) would know, but isn't telling. We would probably find out if some inputs aren't co-prime because the naive multiplying solution breaks, but they could be non-prime and yet co-prime, for example 15, 14, 11, 23 is a set of numbers which are co-prime, but neither 15 nor 14 are prime.