LeetCode:Remove Duplicates from Sorted Array II题目:
给一个排好序的数组,其中有重复元素,要求用O(1)的空间复杂度修改输入的数组。并返回数组最后有效长度。
例子:
Example 1:
Given nums = [1,1,1,2,2,3],
Your function should return length = 5, with the first five elements of nums being 1, 1, 2, 2 and 3 respectively.
It doesn't matter what you leave beyond the returned length.
Example 2:
Given nums = [0,0,1,1,1,1,2,3,3],
Your function should return length = 7, with the first seven elements of nums being modified to 0, 0, 1, 1, 2, 3 and 3 respe