You are given a sorted integer array nums in
non-decreasing order.
Remove the duplicate elements in-place so that each unique element
appears only once.
Notes:
Input: nums = [2,2,3,4]
Output: 3, nums = [2,3,4,_]
Explanation:
There are three unique elements: 2, 3, 4. The remaining element after the first three does not matter.
Input: nums = [1,1,1,2,2,3]
Output: 3, nums = [1,2,3,_,_,_]
Explanation:
The unique elements are 1, 2, 3. Remaining values can be anything.
Input: nums = [0,1,1,2,2,2,3,3,4,4]
Output: 5, nums = [0,1,2,3,4,_,_,_,_,_]
Explanation:
The unique elements are 0, 1, 2, 3, 4.
Accepted:
Submission: