Longest One Chain
Submit solution
Points:
4 (partial)
Time limit:
1.0s
Python
2.0s
Memory limit:
256M
Author:
Problem type
You are give a binary string \(S\) of length \(N\) containing only 0's and 1's. Please find the length of the longest chain of 1's in the string.
Input Specification
The first line will contain the integer \(N\) (\(1 \le N \le 10^5\)). The second line contains the binary string \(S\).
Output Specification
Print one integer: the length of the longest 1 chain.
Sample Input
6
101100
Sample Output
2
Comments