Cody

# Problem 113. N-Queens Checker

Solution 1935464

Submitted on 14 Sep 2019 by Nikolaos Nikolaou
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

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))

l = 1×0 empty double row vector tf = logical 1

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))

l = 2 tf = logical 0

3   Pass
a = [1 0 0 0 0; 0 0 0 1 1]; tf_correct = false; assert(isequal(queens(a),tf_correct))

l = 2 tf = logical 0

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))

l = 1×0 empty double row vector tf = logical 1

5   Pass
a = ones(15,7); tf_correct = false; assert(isequal(queens(a),tf_correct))

l = Columns 1 through 30 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 Columns 31 through 60 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 Columns 61 through 90 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 Columns 91 through 120 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 Columns 121 through 150 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 Columns 151 through 180 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 Columns 181 through 202 15 15 15 15 15 15 15 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 tf = logical 0

6   Pass
a = zeros(20,23); a(1,22) = 1; a(2,23) = 1; tf_correct = false; assert(isequal(queens(a),tf_correct))

l = 2 tf = logical 0

7   Pass
a = [1 0; 0 1]; tf_correct = false; assert(isequal(queens(a),tf_correct))

l = 2 tf = logical 0

8   Pass
a = [1 0 1; 0 0 0; 0 1 0]; tf_correct = false; assert(isequal(queens(a),tf_correct))

l = 2 tf = logical 0

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!