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
1 1 1 1 1
1 0 1 0 1
1 1 1 1 1
1 0 1 0 1
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
1 1 1 1
1 0 1 0
1 1 1 1
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
1 1 1 1 1 1 1
1 0 1 0 1 0 1
1 1 1 1 1 1 1
1 0 1 0 1 0 1
1 1 1 1 1 1 1
1 0 1 0 1 0 1
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
|
Project Euler: Problem 10, Sum of Primes
707 Solvers
4326 Solvers
Convert a numerical matrix into a cell array of strings
455 Solvers
501 Solvers
Check if number exists in vector
4465 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!