Question
Largest Subarray of Positive Integers
You are given an array of KaTeX can only parse string typed expression integers. Your task is to find the length of the largest contiguous subarray that contains only positive integers.
Input
The first line contains a single integer KaTeX can only parse string typed expression — the size of the array.
The second line contains KaTeX can only parse string typed expression integers — KaTeX can only parse string typed expression.
The second line contains KaTeX can only parse string typed expression integers — KaTeX can only parse string typed expression.
Output
Print a single integer — the length of the largest contiguous subarray in which every element is greater than or equal to KaTeX can only parse string typed expression.
Example
Input
8
1 2 -3 4 5 6 -1 2
Output
3
Explanation
The contiguous subarrays containing only positive integers are:
(0, 1) → length = 2
(3, 4, 5) → length = 3
(7) → length = 1
The largest length among them is KaTeX can only parse string typed expression.
8
1 2 -3 4 5 6 -1 2
Output
3
Explanation
The contiguous subarrays containing only positive integers are:
(0, 1) → length = 2
(3, 4, 5) → length = 3
(7) → length = 1
The largest length among them is KaTeX can only parse string typed expression.