Leetcode 487. Max Consecutive Ones II
Given a binary array, find the maximum length of a contiguous subarray of 1s you can get by flipping at most one 0 to 1; this is typically solved with a sliding-window/two-pointer approach that maintains a window containing at most one zero.
Asked at:
Bloomberg
Snapchat
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Late February, 2026
Senior
Late October, 2025
Snapchat
Senior
Hello Interview Premium
Your account is free and you can post anonymously if you choose.