Cody

# Problem 803. Twist 'n' Match

Solution 1879478

Submitted on 20 Jul 2019
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   Fail
n = 2; m = 1; a = twist_n_match(n,m); [r,c] = size(a); assert(r==n && c==n); assert(isequal(nnz(a==rot90(a)),m));

Assertion failed.

2   Pass
n = 3; m = 7; a = twist_n_match(n,m); [r,c] = size(a); assert(r==n && c==n); assert(isequal(nnz(a==rot90(a)),m));

3   Fail
n = 6; m = 6; a = twist_n_match(n,m); [r,c] = size(a); assert(r==n && c==n); assert(isequal(nnz(a==rot90(a)),m));

Assertion failed.

4   Fail
n = 10; m = 11; a = twist_n_match(n,m); [r,c] = size(a); assert(r==n && c==n); assert(isequal(nnz(a==rot90(a)),m));

Assertion failed.

5   Fail
n = 10; m = 14; a = twist_n_match(n,m); [r,c] = size(a); assert(r==n && c==n); assert(isequal(nnz(a==rot90(a)),m));

Assertion failed.

6   Fail
n = 20; m = 83; a = twist_n_match(n,m); [r,c] = size(a); assert(r==n && c==n); assert(isequal(nnz(a==rot90(a)),m));

Assertion failed.

7   Fail
n = 21; m = 1; a = twist_n_match(n,m); [r,c] = size(a); assert(r==n && c==n); assert(isequal(nnz(a==rot90(a)),m));

Assertion failed.