Given a binary string, find the length of the longest run of consecutive 1s you can obtain after at most one swap of any two characters. Then generalise: the longest run of 1s after replacing…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.