Problem 314. Find the sum of the elements in the "second" diagonal
Solution Stats
Problem Comments
-
4 Comments
you might want to make a case that's not a magic square, considering the properties of the diagonals of a magic square...
There are only magic squares in test cases, however the problem doesn't specify a type of the matrix.
You should definitely strengthen the test suite. Lots of solutions rely on both diagonals being the same, even though this is not a property of the stated problem.
The "antidiagonal" is cooler sounding than "second diagonal"
Solution Comments
Show commentsProblem Recent Solvers1176
Suggested Problems
-
Project Euler: Problem 5, Smallest multiple
1621 Solvers
-
Split a string into chunks of specified length
1979 Solvers
-
Given a matrix, swap the 2nd & 3rd columns
1215 Solvers
-
1179 Solvers
-
Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.
951 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!