Cheating ...
Thanks for the note Aurelien. I added to the test suite.
the largest palindrome made from the product of 9999 is 99977999, not 99000099!
and x=999,y=997799, not 906609.
x=2500, y=6249246, not 6167616
x=100, y=999, not 9009
zd c, 99977999 cannot be written as the product of two numbers less than or equal to 9999.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
x = 999;
y_correct = 906609;
assert(isequal(euler004(x),y_correct))
|
2 | Pass |
%%
x = 9999;
y_correct = 99000099;
assert(isequal(euler004(x),y_correct))
|
3 | Fail |
%%
x = 100;
y_correct = 9009;
assert(isequal(euler004(x),y_correct))
Error: Assertion failed.
|
4 | Fail |
%%
x = 2500;
y_correct = 6167616;
assert(isequal(euler004(x),y_correct))
Error: Assertion failed.
|
Least common multiple of many numbers
189 Solvers
Make a random, non-repeating vector.
2795 Solvers
Are all the three given point in the same line?
270 Solvers
191 Solvers
307 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!