• Hello!

    I don't know if solving it in this way has a name. Maybe constraint satisfaction?

    I think it is one natural way of approaching optimization for the problem: constrain the next subset to be explored based on the current subset.

  • I'm interested in this O(f()^2 * logf()) approach that you mentioned. I'd like to learn this optimization. Could you point me to any online reference?

    EDIT: I found your submission. Is this a popular approach? I can't find similar applications online. Would appreciate some references.

  • I like this solution because it does the minimum amount of programmer work.

    This solution is worse than O(n^3) because of the nested for loops, making this an extremely costly solution in time. Storing each set of kPrimes and iterating over it would be a simple optimization. It can further be reduced by restricted the set a based on b and c (taking it to something less than O(f()^2 * logf()), where f() is based on # of primes below s). There are further improvements and maybe someone would have more insight into the time complexity.

  • Rejected as there are an insufficient amount of fixed assertions and no random assertions in the Submit tests.