Count binary substrings
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 answer yet. Write the first one; the best answer gets endorsed.
