Will fail on [0 0 0 0] or any longer vector of 0's.
I know... ;-) but it passes all the cases.
I implement this other solution before: http://www.mathworks.de/matlabcentral/cody/problems/2349-elements-with-highest-local-average/solutions/450770
The Goldbach Conjecture, Part 2
1326 Solvers
Increment a number, given its digits
566 Solvers
Back to basics 12 - Input Arguments
528 Solvers
Back to basics 22 - Rotate a matrix
773 Solvers
1276 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!