Doug: Just wondering if the last test case is incorrect. It seems like for the input of 3200, the p-triplet should be (700, 1152, 1348) and y_correct should be 1087027200. Please do let me know if I am wrong. Cheers, VL.
There is another one: (640,1200,1360). y_correct = 1044480000.
I just noticed that. I had thrown in a new test suite because someone had hardcoded the solutions in. I guess I did not test it right. Problem solved and submissions are being rescored now.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
x = 1000;
y_correct = 31875000;
assert(isequal(euler009(x),y_correct))
|
2 | Pass |
%%
x = 2000;
y_correct = 255000000;
assert(isequal(euler009(x),y_correct))
|
3 | Pass |
%%
x = 320;
y_correct = 1044480;
assert(isequal(euler009(x),y_correct))
|
4 | Fail |
%%
x = 5000;
y_correct = 3984375000
assert(isequal(euler009(x),y_correct))
Error: Assertion failed.
|
Renaming a field in a structure array
731 Solvers
Find state names that start with the letter N
598 Solvers
6281 Solvers
Permute diagonal and antidiagonal
224 Solvers
Natural numbers in string form
347 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!