Count Binary Substrings Hackerrank Solution Java