Remove Duplicates (Sorted)
easyRemove duplicates from sorted array in-place, return new length
Remove Duplicates (Sorted)
Key Insight
Slow pointer marks unique position, fast scans for new unique values
Step 1Setup
slow
0
0fast
0
11
21
32
4→→same direction
Slow at 0 (position for unique), Fast starts scanning from 1.
1 / 5