Company: jpmc_31july
Difficulty: medium
Count Binary Substrings Problem Description Count the number of substrings in a binary string that contain an equal number of 0s and 1s, where all 0s and 1s are grouped together. Duplicate substrings are counted in the total. A binary string consists only of 0s and 1s, and a substring is a contiguous group of characters within the string. Complete the function getSubStringCount in the editor with the following parameter(s): s: a binary string Returns: int: the number of substrings that meet the criteria Examples Example 1: Input: s = "011001" Output: 4 Explanation: The qualifying substrings are "01", "10", "1100", and "01", giving a total of 4. Note that "0110" has equal 0s and 1s but is not counted because the 0s and 1s are not grouped together. Example 2: Input: s = "001100011" Output: 6 Explanation: The substrings "01", "0011", "10", "1100", "01", and "0011" have an equal number of 0s and 1s with consecutive groupings. Example 3: Input: s = "000110" Output: 3 Explanation: The substr