Company: jpmc_31july
Difficulty: medium
Count Binary Substrings Problem Description You are given a binary string s , made up only of the characters '0' and '1' . Count how many substrings of s satisfy both of the following conditions: The substring contains an equal number of 0 s and 1 s. All of the 0 s in the substring are consecutive, and all of the 1 s in the substring are consecutive. A substring is a contiguous, non-empty block of characters of s . Substrings that start at different positions are counted separately, even when they spell the same text. Input Format A single line containing the binary string s . (inferred - the source states a function contract, int getSubstringCount(string s) . Because this judge compares standard output, s is read from one line of standard input and the answer is written to standard output.) Output Format Print a single integer: the number of substrings that satisfy both conditions. (inferred - the source describes an integer return value; it is printed on its own line. Print 0 when no