Cody

# Problem 658. Find the biggest empty box

Solution 2005535

Submitted on 6 Nov 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
a = [1 0; 0 0]; [r1,r2,c1,c2] = biggest_box(a); sub = a(r1:r2,c1:c2); [m,n] = size(sub); len = 1; assert(isequal(sum(sub(:)),0)) assert(isequal(m,len)); assert(isequal(n,len));

Unrecognized function or variable 'sal'. Error in biggest_box (line 24) for i=1:length(sal) Error in Test1 (line 2) [r1,r2,c1,c2] = biggest_box(a);

2   Fail
a = [1 0 0; 0 0 0; 0 0 0]; [r1,r2,c1,c2] = biggest_box(a); sub = a(r1:r2,c1:c2); [m,n] = size(sub); len = 2; assert(isequal(sum(sub(:)),0)) assert(isequal(m,len)); assert(isequal(n,len));

R = 1 1 C = 2 2 R = 3 3 C = 1 1 R = 3 3 C = 1 1 R = 3 3 C = 1 1

Output argument "r1" (and maybe others) not assigned during call to "biggest_box". Error in Test2 (line 2) [r1,r2,c1,c2] = biggest_box(a);

3   Fail
a = eye(9); [r1,r2,c1,c2] = biggest_box(a); sub = a(r1:r2,c1:c2); [m,n] = size(sub); len = 4; assert(isequal(sum(sub(:)),0)) assert(isequal(m,len)); assert(isequal(n,len));

R = 4 4 C = 2 2 R = 3 3 C = 2 2 R = 2 2 C = 2 2 R = 1 1 C = 2 2 R = 9 9 C = 1 1 R = 9 9 C = 1 1 R = 9 9 C = 1 1 R = 9 9 C = 1 1 R = 9 9 C = 1 1 R = 9 9 C = 1 1 R = 9 9 C = 1 1 R = 9 9 C = 1 1 R = 9 9 C = 1 1 R = 9 9 C = 1 1 R = 9 9 C = 1 1 R = 9 9 C = 1 1

Output argument "r1" (and maybe others) not assigned during call to "biggest_box". Error in Test3 (line 2) [r1,r2,c1,c2] = biggest_box(a);

4   Fail
a = double(magic(7)<6); [r1,r2,c1,c2] = biggest_box(a); sub = a(r1:r2,c1:c2); [m,n] = size(sub); len = 4; assert(isequal(sum(sub(:)),0)) assert(isequal(m,len)); assert(isequal(n,len));

R = 7 7 C = 1 1 R = 7 7 C = 1 1 R = 7 7 C = 1 1 R = 7 7 C = 1 1 R = 7 7 C = 1 1 R = 7 7 C = 1 1 R = 7 7 C = 1 1 R = 7 7 C = 1 1 R = 7 7 C = 1 1 R = 7 7 C = 1 1 R = 7 7 C = 1 1 R = 7 7 C = 1 1 R = 7 7 C = 1 1 R = 7 7 C = 1 1 R = 7 7 C = 1 1 R = 7 7 C = 1 1

Output argument "r1" (and maybe others) not assigned during call to "biggest_box". Error in Test4 (line 2) [r1,r2,c1,c2] = biggest_box(a);