Cody

Problem 44633. Sum of diagonals

Solution 1522690

Submitted on 8 May 2018 by David Verrelli
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; s_correct = 1; assert(isequal(maxDiagonalSum(a),s_correct))

s = 1

2   Pass
a = [1 2 3; 2 3 4; 4 5 10]; s_correct = 14; assert(isequal(maxDiagonalSum(a),s_correct))

s = 14

3   Pass
a = [1 2 ; 4 3 ]; s_correct = 6; assert(isequal(maxDiagonalSum(a),s_correct))

s = 6

Suggested Problems

Community Treasure Hunt

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

Start Hunting!