Maximum Difference Of Zeros And Ones In Binary String

easy
1.Given a binary string of 0s and 1s
 2.You have to find the maximum difference of number of 0s and number of 1s (number of 0s - number of 1s) in the substrings of string.
 3.You have to complete the function maxDifference that should return an Integer.

Input Format

1.Single line containing a Binary string

Output Format

Return an Integer

Constraints

1<=|string length|<=105

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
11000010001
Output
6
Previous
Frog Jump
Next
Maximum Length Of Repeated Subarray

Related Questions