dsa1 min read
Remove Element [Easy] — Read/Write Two Pointers
Remove all occurrences of val in-place using a write pointer pattern, returning the new length.
Read →
1575 articles
Remove all occurrences of val in-place using a write pointer pattern, returning the new length.
Remove duplicates in-place from a sorted array using a write pointer that only advances on unique elements.
Merge two sorted arrays in-place from the end to avoid overwriting elements using three pointers.
Check if string s is a subsequence of t using a greedy two-pointer scan that matches characters in order.
Find the maximum number of consecutive 1s achievable by flipping at most k zeros, using a variable sliding window.