|
|
|
|
|
by mcv
1498 days ago
|
|
That's an elegant way to do it. For a brief moment I considered solving this by hand using basically the same idea, but that gets incredibly painful before I even got started. I mean, obviously the extremes get eliminated right away, and then the primes, but then I have to track 10,000 number combinations. |
|
You can actually WLOG away all pairs where the second element is larger than the first.
Also, the most common kind of pair I eliminated was actually due to the size constraint (ie, 98 * 99) or pairs of (1, prime) which I didn't actually realize would be a thing until I coded it up.