Cody

Solution 1980676

Submitted on 17 Oct 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
x = [0 0 0 0 0; 0 2 0 4 0; 0 0 0 0 0; 0 1 0 3 0] output = [2 4; 1 3]; assert(isequal(avengersAssemble(x),output))

x = 0 0 0 0 0 0 2 0 4 0 0 0 0 0 0 0 1 0 3 0

Error using reshape Size vector must be a row vector with integer elements. Error in avengersAssemble (line 4) y=reshape([sqrt(numel(y)) sqrt(numel(y))],y) Error in Test1 (line 7) assert(isequal(avengersAssemble(x),output))

2   Fail
x = [0 0 0 0 0 0 0; 0 2 0 4 0 6 0; 0 0 0 0 0 0 0; 0 1 0 3 0 5 0; 0 0 0 0 0 0 0; 0 7 0 8 0 9 0; 0 0 0 0 0 0 0;] output = [2 4 6; 1 3 5; 7 8 9]; assert(isequal(avengersAssemble(x),output))

x = 0 0 0 0 0 0 0 0 2 0 4 0 6 0 0 0 0 0 0 0 0 0 1 0 3 0 5 0 0 0 0 0 0 0 0 0 7 0 8 0 9 0 0 0 0 0 0 0 0

Error using reshape Size vector must be a row vector with integer elements. Error in avengersAssemble (line 4) y=reshape([sqrt(numel(y)) sqrt(numel(y))],y) Error in Test2 (line 11) assert(isequal(avengersAssemble(x),output))