Count Distinct Elements In An Array Leetcode