This solution is outdated. To rescore this solution, sign in.
-
2 Comments
Jon
on 21 Mar 2014
Best solution that doesn't cheat with a lookup or regexp
empad
on 7 Dec 2020
Think I might have found a problem with merging the original and rotated matrices. In the case of n=7, if you change (1,6) and (2,7) to ones, the output becomes 6 when it should still be 4. If you evaluate the matrices separately then it should work fine, but apart from that this is a really nice solution
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!