Cody

# Problem 658. Find the biggest empty box

Solution 2005524

Submitted on 6 Nov 2019 at 18:04
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));

idx = 16×0 empty double matrix arrfnd = 0 0 0 0

Output argument "r1" (and maybe others) not assigned during call to "biggest_box". 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));

idx = 16×0 empty double matrix arrfnd = 0 0 0 0 0 0 0 0 0

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));

idx = 5 6 15 37 46 47 6 7 16 38 47 48 7 8 17 39 48 49 8 9 18 40 49 50 14 15 24 46 55 56 15 16 25 47 56 57 16 17 26 48 57 58 17 18 27 49 58 59 23 24 33 55 64 65 24 25 34 56 65 66 25 26 35 57 66 67 26 27 36 58 67 68 32 33 42 64 73 74 33 34 43 65 74 75 34 35 44 66 75 76 35 36 45 67 76 77 arrfnd = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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));

idx = 9 10 16 10 11 17 11 12 18 12 13 19 16 17 23 17 18 24 18 19 25 19 20 26 23 24 30 24 25 31 25 26 32 26 27 33 30 31 37 31 32 38 32 33 39 33 34 40 arrfnd = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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);