Sponsored Reserved space — layout preview until AdSense is connected
easy +10 pts

Remove duplicates (sorted)

In-place unique-ification.

Implement `remove_dupes(nums: list[int]) -> list[int]`. Input is sorted. Return a new list with each value appearing once.

Constraints

0 ≤ len(nums) ≤ 10^5

Example

>>> remove_dupes([1,1,2,3,3,4])
[1, 2, 3, 4]
10 points ~10 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

dict.fromkeys preserves order; or just list(dict.fromkeys(nums)).
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.
Sponsored Reserved space — layout preview until AdSense is connected