Backspace String Compare Backwards in Constant Space
Compare typed strings with backspaces in O(1) space, scanning backwards. Python solution and complexity analysis for the two pointers interview pattern.
The Augmented Dev ยท Archive
Dynamics 365, Power Platform, AI, system design, and web development โ filter by theme or search across every post.
Newsletter
One email per post. No spam, no tracking pixels, unsubscribe anytime.
12 of 325 articles tagged two-pointers
Compare typed strings with backspaces in O(1) space, scanning backwards. Python solution and complexity analysis for the two pointers interview pattern.
Maximize trapped area and prove the greedy pointer move is safe. Python solution and complexity analysis for the two pointers interview pattern.
Push all zeroes to the back in one pass, preserving order. Python solution and complexity analysis for the two pointers interview pattern.
Dedupe a sorted array in place with a reader and a writer index. Python solution and complexity analysis for the two pointers interview pattern.
Three-way partition of 0s, 1s and 2s in one pass, no counting. Python solution and complexity analysis for the two pointers interview pattern.
Square a sorted array with negatives and stay O(n), no re-sort. Python solution and complexity analysis for the two pointers interview pattern.
Nearest triplet sum to a target, converging on the smallest gap. Python solution and complexity analysis for the two pointers interview pattern.
All unique triplets summing to zero โ dedupe without a set of tuples. Python solution and complexity analysis for the two pointers interview pattern.
The classic hard: O(1)-space water trapping via boundary maxima. Python solution and complexity analysis for the two pointers interview pattern.
Find a pair summing to target in one pass and O(1) space. Python solution and complexity analysis for the two pointers interview pattern.
Palindrome check with one allowed deletion โ branch only on mismatch. Python solution and complexity analysis for the two pointers interview pattern.
Check a messy string is a palindrome without building a filtered copy. Python solution and complexity analysis for the two pointers interview pattern.