Remove ElementEasy

array two pointers in-place

Remove every occurrence of val from nums in place and return the count k of remaining elements. Two approaches, same problem — switch between them and watch how each rearranges the array.

Press play to watch the algorithm run.
Metrics
Legend
How it works
0 / 0