Maximum Distinct Elements Leetcode Javascript Problems