Minimum flips required to generate continuous substrings of 0âs and 1âs
Given a binary string S of length N, the task is to find the minimum number of bit flips required to convert the given string such that it contains only continuous substrings of 0's and 1's such that the final string is in the form of 000..000, 111..111, 111...000 or 000...111. Examples: Input: S =