Determine the maximum value in the list.
Count the number of elements in the list.
Identify duplicates
Preserve original order
Collect unique elements in order
Determine element frequencies
Sort the list in ascending order.
Mark repeated occurrences
Construct a deduplicated list