Count Binary Substrings Hackerrank Javascript Solutions