結果 : count duplicate elements in array javascript hackerrank solution