Sort an array of 0s, 1s, and 2s in one pass with no extra space using the Dutch National Flag algorithm. Three pointers maintain sorted invariants for all three partitions simultaneously.
Check if a string can become a palindrome by deleting at most one character. Two pointers from both ends; on the first mismatch, try skipping left or skipping right and check if either remainder is a palindrome.
Check whether an integer array can be split into three contiguous parts with equal sum. LeetCode 1013 in O(n) using a greedy single-pass counter, with full Python and JavaScript code.
Solve LeetCode 42 Trapping Rain Water in O(n) time and O(1) space using the canonical two-pointer technique. Includes intuition, dry run, Python and JavaScript code, and follow-up variants.
Complete master cheatsheet of every two-pointer and sliding window pattern used in coding interviews. Includes template code, problem index, decision tree, and MAANG priority list.