Maximum Distinct Elements Leetcode Javascript Questions