Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
n = 5;
a = [1 0 1 0 1;
0 1 0 1 0;
1 0 1 0 1;
0 1 0 1 0;
1 0 1 0 1];
assert(isequal(a,checkerboard(n)))
a =
1 0 1 0 1
0 1 0 1 0
1 0 1 0 1
0 1 0 1 0
1 0 1 0 1
|
2 | Pass |
n = 4;
a = [1 0 1 0;
0 1 0 1;
1 0 1 0;
0 1 0 1];
assert(isequal(a,checkerboard(n)))
a =
1 0 1 0
0 1 0 1
1 0 1 0
0 1 0 1
|
3 | Pass |
n = 7;
a = [1 0 1 0 1 0 1
0 1 0 1 0 1 0
1 0 1 0 1 0 1
0 1 0 1 0 1 0
1 0 1 0 1 0 1
0 1 0 1 0 1 0
1 0 1 0 1 0 1];
assert(isequal(a,checkerboard(n)))
a =
1 0 1 0 1 0 1
0 1 0 1 0 1 0
1 0 1 0 1 0 1
0 1 0 1 0 1 0
1 0 1 0 1 0 1
0 1 0 1 0 1 0
1 0 1 0 1 0 1
|
Swap the first and last columns
12415 Solvers
2240 Solvers
Project Euler: Problem 8, Find largest product in a large string of numbers
315 Solvers
401 Solvers
264 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!