Count Distinct Element Leetcode Two