Since Cody, I dislike for-loops, but your solution is way simpler than my own algorithm. Mission accomplished...
Nevertheless, I would hope for a non-looped piece of code. Let's see in phase 3.
Find the longest sequence of 1's in a binary sequence.
3419 Solvers
2999 Solvers
165 Solvers
329 Solvers
Return a list sorted by number of consecutive occurrences
176 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!