testsuite doesn't work since mid 2014.
Anyway, the smallest non-spiral solution there.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
x = 3;
y_correct = [
1 2 3
8 9 4
7 6 5
];
assert(isequal(pyramid(x),y_correct))
|
2 | Pass |
%%
x = 6;
y_correct = [
1 2 3 4 5 6
20 21 22 23 24 7
19 32 33 34 25 8
18 31 36 35 26 9
17 30 29 28 27 10
16 15 14 13 12 11
];
assert(isequal(pyramid(x),y_correct))
|
3 | Pass |
%%
x = 1;
y_correct = 1;
assert(isequal(pyramid(x),y_correct))
|
9831 Solvers
2501 Solvers
Project Euler: Problem 8, Find largest product in a large string of numbers
315 Solvers
180 Solvers
436 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!