Given a non-decreasing array of integers, return a new array containing each value once in sorted order.
Examples
Input:[1,1,2]
Output:[1,2]
Input:[0,0,1,1,1,2,2,3,3,4]
Output:[0,1,2,3,4]
Hints
Use two pointers: one to iterate through the array (`read_index`) and another to track the position of the last unique element (`write_index`).
Compare the current element with the last unique element. If they are different, copy the current element to the `write_index` position and increment `write_index`.
After processing all elements, return the subarray from index `0` to `write_index - 1` as the result.