Q: Given an array of 0s and 1s. Count of 0s and 1s are always even. Find all ways of dividing an array into sub-sections having half of 1s and half of 0s.
eg:
11110000
total 1s = 4 & 0s = 4. So each sub-sections in the result must have two 1s and two 0s.
output: 1100
1101100110
output:
10110
11001
10011
my approach:
I could not solve it completely though.
Can anyone help me in working on solution for this problem?