The divisors approach is an interesting one. I’d first compare it to the one here:
The biggest difference between solution 4 and yours is that they keep less intermediate values than you do.
The divisors approach is an interesting one. I’d first compare it to the one here:
The biggest difference between solution 4 and yours is that they keep less intermediate values than you do.