Given a sorted array `nums`, remove the duplicates in-place such that each element appears only once. Return the new length after removal.
nums = sorted array of integers
new length of array after removing duplicates
Example 1:
Input:
nums = [1,1,2]
Output:
2
Explanation:
Remove duplicates [1,1] -> [1], new length is 2 (array [1,2]).
Example 2:
Input:
nums = [0,0,1,1,1,2,2,3,3,4]
Output:
5
Explanation:
Result array [0,1,2,3,4], length 5.