Maximum Number of Distinct Elements After Operations
Sort the values and give each one the smallest new value within k that is above the previous assignment.
Sort the values and give each one the smallest new value within k that is above the previous assignment.