Count Binary Substrings Leetcode Javascript