Min flips of continuous characters to make all characters alternate in a binary string.

given a binary string of length n, with n/2- 0 and n/2- 1,what is the minimum amount of flips of continuous characters that is needed in order to alternate the string? Example: input - 1001 output: 1 (by flipping the last two digits)

The answer: the output for the binary string 0 0 0 1 0 1 1 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 0 0 1 1 0 1 1 1 1 0 0 1 0 0 1 1 1 0


The answer is 8.

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.

0 solutions

No explanations have been posted yet. Check back later!

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...