โ† Amazon questions

Longest continuous 1s by flipping one 0

Filed under Amazon

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.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.