You are given an integer array nums.
You repeatedly perform the following operation until nums becomes empty:
Identify all distinct elements present in nums.
Append these distinct elements in ascending order to an array ans.
Remove one occurrence of each of these identified elements from nums.
Return the resulting array ans.
Constraints:
nums.length
nums[i]
You are given an integer array nums.
You repeatedly perform the following operation until nums becomes empty:
Identify all distinct elements present in nums.
Append these distinct elements in ascending order to an array ans.
Remove one occurrence of each of these identified elements from nums.
Return the resulting array ans.
Constraints:
nums.length
nums[i]