Gotta give up, two perfectly working solutions when run in Matlab consistently produce errors:
While evaluating the solution, the server encountered an error caused by long running MATLAB code. Edit the code if needed and then submit.
Not my problem, it's the server that has a problem running simple (and fast) code!
your solution takes a VERY long time to solve problem 7 in the testsuite (on my computer this takes around 3 minutes; Cody has a timeout of approximately 30 seconds). Problem 7 has a ridiculously high n_max value, I imagine precisely to encourage players to go beyond pre-computing-all-primes-within-range-type of solutions...
5704 Solvers
3238 Solvers
The Goldbach Conjecture, Part 2
1285 Solvers
401 Solvers
401 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!