Maximize Sum of At Most K Distinct Elements
Sort the distinct values from largest to smallest and keep the first k; every value is positive, so more picks always help.
Sort the distinct values from largest to smallest and keep the first k; every value is positive, so more picks always help.