You are given an numeric string A which only contains 0's and 1's. You have to find a range, such that if we flip all the elements within the range, we will get largest substring of contiguous 1's.
Return the length of largest substring of contiguous 1's after flipping exactly one substring.
1 <= |A| <= 105
First and only argument is an string A.
Return an integer denoting the length of largest substring of contiguous 1's after flipping exactly one substring.
A = "000"
A = "10010"
Flip the substring [0:2] then A = "111" so answer will be 3
Flip the substring [1:2] then A = "11110" so answer will be 4
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.