Count Distinct Element Leetcode Javascript Questions