Programming problem: Max Consecutive Ones Track the current streak of 1s and reset on 0. A single pass through the array in O(n) time and O(1) space gives you the maximum consecutive count — no extra data structures needed.