Running from both ends of an array
The first type of problems are, having two pointers at left and right end of array, then moving them to the center while processing something with them.

2 Sum problem (*) https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/ https://leetcode.com/problems/3sum/ https://leetcode.com/problems/4sum/ https://leetcode.com/problems/number-of-subsequences-that-satisfy-the-given-sum-condition/ https://leetcode.com/problems/two-sum-iv-input-is-a-bst/ https://leetcode.com/problems/sum-of-square-numbers/ https://leetcode.com/problems/boats-to-save-people/ https://leetcode.com/problems/minimize-maximum-pair-sum-in-array/ https://leetcode.com/problems/3sum-with-multiplicity/
Reversing / Swapping https://leetcode.com/problems/valid-palindrome/ (*) https://leetcode.com/problems/reverse-string/ https://leetcode.com/problems/reverse-vowels-of-a-string/ https://leetcode.com/problems/valid-palindrome-ii/ https://leetcode.com/problems/reverse-only-letters/ https://leetcode.com/problems/remove-element/ https://leetcode.com/problems/sort-colors/ https://leetcode.com/problems/flipping-an-image/ https://leetcode.com/problems/squares-of-a-sorted-array/ https://leetcode.com/problems/sort-array-by-parity/ https://leetcode.com/problems/sort-array-by-parity-ii/ https://leetcode.com/problems/pancake-sorting/ https://leetcode.com/problems/reverse-prefix-of-word/ https://leetcode.com/problems/reverse-string-ii/ https://leetcode.com/problems/reverse-words-in-a-string/ https://leetcode.com/problems/reverse-words-in-a-string-iii/
Others https://leetcode.com/problems/bag-of-tokens/ https://leetcode.com/problems/di-string-match/ https://leetcode.com/problems/minimum-length-of-string-after-deleting-similar-ends/ https://leetcode.com/problems/sentence-similarity-iii/ https://leetcode.com/problems/find-k-closest-elements/ https://leetcode.com/problems/shortest-distance-to-a-character/
Last updated
Was this helpful?