Remove Duplicates from Sorted Array — JavaScript easy interview problem
Given a sorted array `nums`, remove duplicates in-place so each unique element appears once. Return the new length `k`. The first `k` elements of `nums` should hold the result (order preserved). Return `[k, nums.slice(0, k)]` for judging.
Tags: two-pointers
Practice this Arrays problem free in the JS Interview Playground with automated tests and unlockable solutions.