Problems > Compact a Sorted Array > Editorial

Compact a Sorted Array — Solution & Editorial

Back to the Problem

Two-pointer overwrite (or emit values differing from the previous one).

Complexity: O(N)