Problem 3900 · Medium

Longest Balanced Substring After One Swap

Use at most one swap in a binary string, then pick the longest substring with equal zeros and ones.

Open the interactive visualisation