Cody

# Problem 43569. Avengers Assemble!

Solution 1698516

Submitted on 22 Dec 2018 by HH
• Size: 9
• This is the leading solution.
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
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 [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In avengersAssemble (line 2) In ScoringEngineTestPoint1 (line 7) In solutionTest (line 3)]

2   Pass
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 [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In avengersAssemble (line 2) In ScoringEngineTestPoint2 (line 11) In solutionTest (line 5)]

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!