Remove duplicates from a sorted array in-place
Filed under Curefit
The question
Given a sorted array with duplicate elements, remove the duplicates such that each element appears only once. Return the new length of the array without using extra space.
No write-up yet. Related questions below have one.
Related Curefit questions
Collected from public candidate posts and coding forums. Updated Nov 2026.