Algorithm · Salesforce · Hard
Minimize Maximum Run Length in Binary String Medium · Binary Search, String, Greedy · [Company Tags] · [Hints] You are given a binary string s composed of 0s and 1s, along with an integer k. You may perform up to k bit-flip operations, where each operation changes a single character from 0 to 1 or from 1 to 0. After applying these flips, examine the lengths of all contiguous blocks of identical characters. Let L be the length of the longest such block. Determine the smallest…
Checking your access…