Remove Duplicates from Sorted Array

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]
Hints

Remove Duplicates from Sorted Array

Given a non-decreasing array of integers, return a new array containing each value once in sorted order.