The test suite already spoils the solution.
True. In general that should be avoided, although admittedly it's difficult here because if the correct answer were hard-coded, then changes to: (i) the hardware on which Cody runs; or (ii) the version of MATLAB that Cody employs may eventually invalidate it. Having said that, the Test Suite could still be tightened up (see e.g. Solution 1461085).
Find the sum of the elements in the "second" diagonal
1006 Solvers
388 Solvers
Magic is simple (for beginners)
3214 Solvers
278 Solvers
07 - Common functions and indexing 1
354 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!