This is a verified interview question from Adobe. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Adobe - Good Binary Strings - Adobe Online Assessment 2025 PYQ IIT Preferred" covers key patterns like Arrays.
"Pattern: 2 DSA + 60 MCQS In a good binary string: The number of 0s equals the number of 1s. For every prefix of the string, the number of 1s is greater than or equal to the number of 0s. Optimize a "good" binary string by rearranging its good substrings to create the largest possible numeric value. Rules A good string can contain multiple good substrings. Two adjacent good substrings can be swapped if the resulting string remains good. Two substrings are adjacent if the last character of the first substring is immediately before the first character of the second substring. Perform zero or more swap operations on adjacent good substrings to form the binary string with the largest possible numeric value and return that value. Example binString = "1010111000" There are two good binary substrings, "1010" and "111000", among others. Swap these two substrings to get a larger value: 1110001010 This is the largest possible good string that can be formed. Function Description Complete the function getLargestGoodBinaryString in the editor below. ```getLargestGoodBinaryString``` has the following parameter: string binString: a good binary string. Returns string: the lexicographically largest good binary string that can be obtained."
Join thousands of developers practicing for Adobe.