Check in draft: Count Number of Distinct Elements in an Array with Duplicates