Problem
Remove duplicates in place from a sorted array and return the new length, then discuss the unsorted-array variant.
Input / Output
nums.k; the first k elements hold the distinct values in order.Constraints
Example
[1,1,2,3,3] → [1,2,3], length 3