You are given a string $$S$$ of length $$N$$. Each character of the string is either $$0$$ or $$1$$. Now, you need to select the largest substring in which the count of $$0$$ in the string is more than the count of $$1$$. Print the maximum possible length of the subarray in the output.
Input
The first line contains an integer $$N$$ as input.
The next line contains a string comprising of $$0$$ and $$1$$. The length of this string is exactly $$N$$.
Output
In the output print the length of the largest substring in which the count of $$0$$ is more than $$1$$.
Constraints
$$1 \le N \le 10^5$$
The last three characters i.e. $$100$$ forms a substring of length $$3$$ which is the largest substring possible in which $$0$$ are more than $$1$$.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor