Search
⌘K

Leetcode 26. Remove Duplicates from Sorted Array

Given a sorted array, remove duplicates in-place so each unique value appears only once (preserving order) and return the count k of unique elements. This is typically solved by a two-pointer scan that overwrites duplicates without using extra space.

Asked at:

Meta


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early October, 2025

Meta

Mid-level

Early September, 2025

Meta

Senior

Late May, 2025

Meta

Staff

Comments

Your account is free and you can post anonymously if you choose.