← ALL NOTES
Array

26. Remove Duplicates from Sorted Array

Because the array is sorted, every run of equal values is contiguous — so a new unique element is just one that differs from its immediate predecessor. That turns dedup into a slow/fast two-pointer…

Loading…