This solution is outdated. To rescore this solution, sign in.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
a = [1 0 0; 0 0 1; 0 0 0];
tf_correct = true;
assert(isequal(queens(a),tf_correct))
|
2 | Pass |
%%
a = [0 0 0 1; 1 0 0 0; 0 0 1 0; 0 1 0 0];
tf_correct = false;
assert(isequal(queens(a),tf_correct))
|
3 | Pass |
%%
a = [1 0 0 0 0; 0 0 0 1 1];
tf_correct = false;
assert(isequal(queens(a),tf_correct))
|
4 | Pass |
%%
a = [ ...
0 0 1 0 0 0 0 0; 0 0 0 0 0 0 1 0; 0 1 0 0 0 0 0 0; 0 0 0 0 0 0 0 1;
0 0 0 0 0 1 0 0; 0 0 0 1 0 0 0 0; 1 0 0 0 0 0 0 0; 0 0 0 0 1 0 0 0];
tf_correct = true;
assert(isequal(queens(a),tf_correct))
|
5 | Pass |
%%
a = ones(15,7);
tf_correct = false;
assert(isequal(queens(a),tf_correct))
|
6 | Pass |
%%
a = zeros(20,23);
a(1,22) = 1;
a(2,23) = 1;
tf_correct = false;
assert(isequal(queens(a),tf_correct))
|
7 | Pass |
%%
a = [1 0; 0 1];
tf_correct = false;
assert(isequal(queens(a),tf_correct))
|
3967 Solvers
495 Solvers
Back to basics 18 - justification
176 Solvers
Create a square matrix of multiples
383 Solvers
Sum the numbers on the main diagonal
453 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!