Remove Element
easyRemove all instances of value in-place, return new length
Remove Element
Key Insight
Slow pointer builds result, fast scans. Copy non-target values to slow position.
Step 1Setup
Remove value: 3
slow
fast
3
02
12
23
3→→same direction
Remove all 3s from [3,2,2,3]. slow=0, fast scans.
1 / 5