This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
a = 1;
s_correct = 1;
assert(isequal(maxDiagonalSum(a),s_correct))
|
2 | Pass |
a = [1 2 3; 2 3 4; 4 5 10];
s_correct = 14;
assert(isequal(maxDiagonalSum(a),s_correct))
|
3 | Pass |
a = [1 2 ; 4 3 ];
s_correct = 6;
assert(isequal(maxDiagonalSum(a),s_correct))
|
19337 Solvers
324 Solvers
302 Solvers
131 Solvers
Sum of adjacent elements in a vector
468 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!