13. Remove Duplicates from Sorted Array
Given an array nums sorted in non-decreasing order, remove duplicates in place so each element appears once, and return the new length.
範例 1:
輸入: nums = [1,1,2] 輸出: 2
範例 2:
輸入: nums = [0,0,1,1,1,2,2,3,3,4] 輸出: 5
限制條件:
1 <= nums.length <= 3 * 10^4nums is sorted in non-decreasing order.