Arrays

Remove Duplicates from Sorted Array

easy
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.
Hint steps(0/2 revealed)
  1. 1

    Complete previous step or reveal to unlock this hint.

  2. 2

    Complete previous step or reveal to unlock this hint.