Given a binary array consisting of 0s and 1s, find the index of a 0 that, if flipped to 1, maximizes the length of the resulting contiguous sequence of 1s. Return -1 if there are no zeros to flip.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.