← Questions
Count binary substrings
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Count the non-empty substrings of a binary string that have the same number of 0s and 1s, with all the 0s together and all the 1s together. Solve it in one pass by comparing lengths of consecutive runs.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding
