Given a binary string of 0s and 1s. Find the minimum number of flips required to change the string such that it does’nt contain the substring 101.
Iterate from left to right and change every substring 101 to 100.
Count number of such changes.
complexity: O(N) for each Test case.
can be found here