I am getting the correct length of sub array, but as told in the video we need to iterate till right iterator reaches null, the array that i am getting is different from what the sample output should be.
Sample Output is :
5
1 0 0 1 1 1 1 1 0 1
and what i am getting is :
5
1 0 0 1 0 1 1 1 1 1
Here is the code: https://ide.codingblocks.com/s/107203