Chris has a
binary
string. He wants to remove the
substring
101
because it looks a lot like a lol message. To do so he can make a switch operation (change 0 to a 1 or vice versa). What is the minimum number of switches Chris has to do on the
string
so he can remove all the sub-strings?
Details and Assumptions
If Chris is given the string
1010101
the minimum number of swich operations would be 2.
1 2 3 |
|
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Simplify use Ctrl + F. It shows there are 90 of them. Since the string is displayed twice in the browser, the answer is 9 0 ÷ 2 = 4 5