Given an array whose elements are either 1 or 0, find i and j such that 0<=i<=j<arr.size and we get maximum number of 1 after we flip 0 to 1 and 1 to 0 within range [i,j]
sure. For example when input is [1, 0, 0, 1, 0, 0, 1, 0], the function should return (1,5). Because after we flip bits between 1 and 5, the array changes to [1,1,1,0,1,1,1,0] and it has six 1 which is the maximum number of 1 we can get by flipping bits in a range
find the maximum number zeros in an array with one flip of a subarray allowed. A flip operation switches all 0s to 1s and 1s to 0s.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.