This solution is outdated. To rescore this solution, sign in.
-
1 Comment
John D'Errico
on 28 Jan 2012
Of course, this solution, while short, is NOT the best solution! Clearly the best solution is the far more efficient: n*(n+1)/2
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!