Maximum Distinct Elements After Removing K Elements Leetcode Javascript