Problem 487 · Medium

Max Consecutive Ones II

Find the longest run of ones obtainable by flipping at most one zero.

Open the interactive visualisation