nums is sorted in non-decreasing order. Return a new list with each value kept once, still in order. Do not use set: use the fact that the list is sorted.
Example 1
Input:
dedupe_sorted([1, 1, 2, 2, 2, 3])
Output:
[1, 2, 3]
Example 2
Input:
dedupe_sorted([4, 4, 4])
Output:
[4]
0 <= len(nums) <= 3 * 10**5nums is sorted in non-decreasing order.No results yet
Run your code to check it against the examples, or submit to run every test.