Lucid Motors Interview Question

How to remove the duplicates from a sorted array?