Max Consecutive Ones
Easy · rating 950 · Arrays
The first line has n. The second line has n integers, each 0 or 1. Print the length of the longest run of consecutive 1s.
Constraints: 1 ≤ n ≤ 105
Related problems
- Interleave Arrays — Easy
- Low Stock Alert — Easy
- Move Zeroes — Easy
- Plus One — Easy
- Prefix Sums — Easy
- Account Balance — Easy