Given a sorted array `nums`, remove the duplicates in-place such that each element appears only once and return the new length of the array.
nums = sorted array of integers
new length after removing duplicates
Example 1:
Input:
nums = [0,0,1,1,2,2,3,3]
Output:
4
Explanation:
After removal [0,1,2,3], length 4.
Example 2:
Input:
nums = [1,1,2]
Output:
2
Explanation:
After removal [1,2], length 2.