Cody

# Problem 44658. Kurosu solver

Solution 1684507

Submitted on 1 Dec 2018 by William
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); b1 = kurosusolver(b0); assert(isempty(b1))

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]; b1 = kurosusolver(b0); assert(~isempty(b1) && all(ismember(bin2dec(char(48+[b1;b1'])),str2num('11,13,19,21,22,25,26,37,38,41,42,44,50,52'))))

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]; b1 = kurosusolver(b0); assert(~isempty(b1) && all(ismember(bin2dec(char(48+[b1;b1'])),str2num('11,13,19,21,22,25,26,37,38,41,42,44,50,52'))))

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]; b1 = kurosusolver(b0); assert(~isempty(b1) && all(ismember(bin2dec(char(48+[b1;b1'])),str2num('11,13,19,21,22,25,26,37,38,41,42,44,50,52'))))

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]; b1 = kurosusolver(b0); assert(~isempty(b1) && all(ismember(bin2dec(char(48+[b1;b1'])),str2num('11,13,19,21,22,25,26,37,38,41,42,44,50,52'))))

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]; b1 = kurosusolver(b0); assert(isempty(b1))

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]; b1 = kurosusolver(b0); assert(isempty(b1))

9   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]; b1 = kurosusolver(b0); b2 = zeros(6); b2(4,2) = 2; assert(isequal(b1,b0+b2))