Count Binary Substrings Leetcode Javascript Solution