Distinct Elements Problem