← Oracle questions
CodingReported in a candidate post, Jul 2025

Longest run of ones with at most one swap, extended to k replacements

Filed under Oracle

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.

Related Oracle questions

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