Minimum replacements for binary string to be sorted
Given a binary string of 0 and 1 eg. “001010”. You can replace a 0 with 1 or a 1 with a 0. Write an algorithm that gives the minimum number of replacements to be made in order for the binary string to be sorted (all the 0s come before the 1s). Eg. “0011110010” –> … Read more