Cody

# Problem 44658. Kurosu solver

Solution 1544325

Submitted on 30 May 2018 by HH
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
filetext = fileread('kurosusolver.m'); assert(isempty(strfind(filetext,'eval'))) assert(isempty(strfind(filetext,'echo'))) assert(isempty(strfind(filetext,'switch')))

2   Pass
b0 = zeros(6); assert(isempty(kurosusolver(b0)))

3   Pass
b0 = [-1 -1 -1 0 -1 -1 -1 -1 -1 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 1 -1 -1 -1 -1 1 1 -1 -1 1 -1 -1 -1]; assert(isequal(kurosusolver(b0),[1 1 0 0 1 0;0 1 1 0 0 1;1 0 0 1 1 0;0 1 0 1 0 1;0 0 1 0 1 1;1 0 1 1 0 0]))

4   Pass
b0 = [ 1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -1 1 -1 -1 0 -1 -1 -1 -1]; assert(isequal(kurosusolver(b0),[1 0 0 1 1 0;0 1 1 0 0 1;0 1 1 0 1 0;1 0 0 1 0 1;1 1 0 0 1 0;0 0 1 1 0 1]))

5   Pass
b0 = [-1 -1 0 -1 0 0 -1 -1 -1 1 -1 1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 0 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1]; assert(isequal(kurosusolver(b0),[1 1 0 1 0 0;1 0 0 1 0 1;0 1 1 0 1 0;1 0 1 0 0 1;0 1 0 1 1 0;0 0 1 0 1 1]))

6   Pass
b0 = [1 0 0 1 1 0 0 0 1 0 1 1 1 1 0 1 0 0 0 1 1 0 0 1 1 0 1 0 1 0 0 1 0 1 0 1]; assert(isequal(kurosusolver(b0),b0))

7   Pass
b0 = [1 0 0 1 1 0 0 0 1 0 1 1 1 1 0 1 0 0 0 1 1 0 0 1 0 0 1 1 1 0 1 1 0 0 0 1]; assert(isempty(kurosusolver(b0)))

8   Pass
b0 = [0 1 0 1 1 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 1 1 0 1 1 0 1 0 1 0 0 1 0 0 1 1]; assert(isempty(kurosusolver(b0)))