You are right about these strings that it doesn't get, as well as:
.
.
.
01001011111
.
.
.
11011001011
.
.
etc
but i don't need to hold them in memory, i simply check each one of them individually and move to the other;
but this algorithm surely seems to work Fast.
If only to fix it a bit to show every variation like the ones you stated, considering it shall slow in twice or three times, with will be wonderful.