Given an integer array nums sorted in non decreasing order, modify the array in place such that each unique element appears at most
Return k, representing the number of valid elements in nums after removing the excess duplicates. The first k elements of nums must contain the final result. The elements remaining beyond the first k positions do not matter.
Constraints:
nums.length
nums[i]
nums is sorted in non decreasing order.
Given an integer array nums sorted in non decreasing order, modify the array in place such that each unique element appears at most
Return k, representing the number of valid elements in nums after removing the excess duplicates. The first k elements of nums must contain the final result. The elements remaining beyond the first k positions do not matter.
Constraints:
nums.length
nums[i]
nums is sorted in non decreasing order.