VIII. Bonus. (+10 points) Given a binary string s[1..n] of length n bits (i.e., each s[i] is either 0 or 1), give an O(n
Posted: Mon Jun 06, 2022 6:33 pm
VIII. Bonus. (+10 points) Given a binary string s[1..n] of length n bits (i.e., each s is either 0 or 1), give an O(n)-time algorithm that outputs a maximum-length substring r of s, such that the number of 0's in r is equal to the number of 1's. (Note that such a substring z might be the empty substring.) Recall that a substring of s is a sequence of consecutive bits in s.