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
Return the largest number that is adjacent to a zero
3756 Solvers
Remove any row in which a NaN appears
6837 Solvers
1366 Solvers
405 Solvers
Project Euler: Problem 10, Sum of Primes
710 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!