Array
80. Remove Duplicates from Sorted Array II
One write pointer, index, marks where the next kept element goes — and since the first two elements are always allowed, it starts at 2. The whole rule is: keep nums[i] only if it differs from…
Loading…