Skip to content

Two Pointers Problems

The two-pointer technique uses two indices moving through data to solve problems in linear time. Common patterns: converging pointers, fast-slow pointers, and sliding windows on sorted arrays.

22 problems

Title Difficulty
3Sum Medium
3Sum Closest Medium
4Sum Medium
Backspace String Compare Easy
Container With Most Water Medium
Find the Duplicate Number Easy
Happy Number Easy
Linked List Cycle Easy
Merge Sorted Array Easy
Merge Two Sorted Lists Easy
Middle of the Linked List Easy
Move Zeroes Easy
Palindrome Linked List Easy
Reorder a Linked List Medium
Remove Duplicates from Sorted Array Easy
Remove Nth Node From End of List Medium
Reorder List Medium
Reverse Words in a String Medium
Sort Colors Medium
Sort Colors (One-Pass, Constant Space) Medium
Trapping Rain Water Hard
Valid Palindrome II Easy