LOL String

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
1010101
1000101
1000111
×

Problem Loading...

Note Loading...

Set Loading...