Cody

# Problem 2160. The 17x17 Problem

Solution 2207136

Submitted on 12 Apr 2020
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
n = 5; a = no_recs(n); d = size(a); assert(isequal(d,[n n])); % Only the numbers 1:4 tf = isempty(setdiff(a,[1 2 3 4])); assert(tf) % No rectangles tf = ~any(arrayfun(@(n)any(sum((a==n)'*double(a==n)>1)>1),1:4)); assert(tf)

2   Fail
n = 8; a = no_recs(n); d = size(a); assert(isequal(d,[n n])); % Only the numbers 1:4 tf = isempty(setdiff(a,[1 2 3 4])); assert(tf) % No rectangles tf = ~any(arrayfun(@(n)any(sum((a==n)'*double(a==n)>1)>1),1:4)); assert(tf)

Assertion failed.

3   Fail
n = 12; a = no_recs(n); d = size(a); assert(isequal(d,[n n])); % Only the numbers 1:4 tf = isempty(setdiff(a,[1 2 3 4])); assert(tf) % No rectangles tf = ~any(arrayfun(@(n)any(sum((a==n)'*double(a==n)>1)>1),1:4)); assert(tf)

Assertion failed.

### Community Treasure Hunt

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

Start Hunting!