Count Distinct Element Leetcode Two Pointers