Ilya Amursky
  • About me

Algorithms

Programming problem: Max Consecutive Ones

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.
Ilya Amursky 27 Mar 2026
  • Privacy Policy
  • Terms of Service
© 2026 Ilya Amursky