Cody

Problem 658. Find the biggest empty box

Solution 1151243

Submitted on 31 Mar 2017 by Nishant Chandrashekhar
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
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));

r1 = 1 r2 = 1 c1 = 2 c2 = 2

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

r1 = 1 r2 = 2 c1 = 2 c2 = 3

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

r1 = 1 r2 = 4 c1 = 5 c2 = 8

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

r1 = 2 r2 = 5 c1 = 2 c2 = 5
The text passage describes a problem statement and a series of test cases for a function that finds the largest empty submatrix in a given matrix. Each test case includes input data, expected output, and assertions to validate the correctness of the solution.
multiple_questions_with_answers

explanation:
- the passage contains multiple test cases, each of which can be considered a separate question.
- each test case includes the input matrix, the expected output (the coordinates of the largest empty submatrix), and assertions to verify the solution.
- the answers (expected outputs) are provided within the test cases.
Given a text passage, determine:
    1. If it contains a mathematical question (including word problems or calculations)
    2. If an answer to that mathematical question is provided in the text

First, describe the content structure you found in 1-2 sentences.

Then provide your analysis in the following format:
TYPE: <one of the following values>
- NO_QUESTION
- SINGLE_QUESTION
- SINGLE_QUESTION_WITH_ANSWER
- MULTIPLE_QUESTIONS
- MULTIPLE_QUESTIONS_WITH_ANSWERS
system
Cody

Problem 658. Find the biggest empty box

Solution 1151243

Submitted on 31 Mar 2017 by Nishant Chandrashekhar
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
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));

r1 = 1 r2 = 1 c1 = 2 c2 = 2

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

r1 = 1 r2 = 2 c1 = 2 c2 = 3

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

r1 = 1 r2 = 4 c1 = 5 c2 = 8

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

r1 = 2 r2 = 5 c1 = 2 c2 = 5
user
The text passage describes a problem statement and a series of test cases for a function that finds the largest empty submatrix in a given matrix. Each test case includes input data, expected output, and assertions to validate the correctness of the solution.

TYPE: MULTIPLE_QUESTIONS_WITH_ANSWERS

Explanation:
- The passage contains multiple test cases, each of which can be considered a separate question.
- Each test case includes the input matrix, the expected output (the coordinates of the largest empty submatrix), and assertions to verify the solution.
- The answers (expected outputs) are provided within the test cases.