LeetCodechevron_rightCategorieschevron_righttwo pointers
compare_arrows

two pointers

182 problems
Easy: 54Medium: 104Hard: 24

two pointers is one of the most repeated interview dimensions. Start with edge-safe fundamentals, then move into pattern-level trade-offs.

Interview Signal

Frequently tests problem modeling, edge handling, and verbal clarity.

Common Pitfall

Template-only answers break under follow-up questioning.

Practice Strategy

Practice in 3-5 problem rounds and always review complexity alternatives.

Recommended Progression

Problem bank

two pointers problem bank

Start with a compact scan-friendly list and progressively load more so the topic page stays readable even when the corpus is large.

Progressive topic library

Built for large topic sets: scan the structure first, then go deeper.

hourglass_bottomScroll to continue
search
tuneDifficulty

Showing 24 / 182 problems

+24 per load
#TitleDifficulty
5

Longest Palindromic Substring

Find the longest contiguous palindromic substring in a given string using dynamic programming and two-pointer expansion …

Medium
11

Container With Most Water

Find two vertical lines that can form a container with the most water in a given array of heights.

Medium
15

3Sum

Given an integer array, return all unique triplets where the sum is zero using two-pointer scanning with careful duplica…

Medium
16

3Sum Closest

Find the sum of three integers in an array that is closest to a given target using two-pointer scanning.

Medium
18

4Sum

The 4Sum problem requires finding all unique quadruplets in an array that sum to a specific target value.

Medium
19

Remove Nth Node From End of List

Remove the nth node from the end of a linked list using a two-pointer approach to solve efficiently.

Medium
26

Remove Duplicates from Sorted Array

Learn how to remove duplicates from a sorted array in-place using two-pointer scanning while preserving element order.

Easy
27

Remove Element

Remove Element challenges you to remove a value from an array in-place using efficient two-pointer scanning and tracking…

Easy
28

Find the Index of the First Occurrence in a String

Locate the first occurrence of a substring within a string using a two-pointer scanning strategy and invariant tracking …

Easy
31

Next Permutation

Next Permutation is a medium-difficulty problem focusing on generating the next lexicographically greater permutation of…

Medium
42

Trapping Rain Water

Calculate the total trapped rain water using the elevation map array, leveraging dynamic programming and two-pointer pat…

Hard
61

Rotate List

Rotate a singly linked list to the right by k positions using careful pointer manipulation and two-pointer traversal tec…

Medium
75

Sort Colors

Sort Colors requires in-place reordering of an array using a two-pointer scanning strategy to group 0s, 1s, and 2s effic…

Medium
80

Remove Duplicates from Sorted Array II

Solve the problem of removing duplicates from a sorted array in-place, ensuring each element appears at most twice, usin…

Medium
82

Remove Duplicates from Sorted List II

Remove duplicates from a sorted linked list, leaving only distinct values, and return the modified list in sorted order.

Medium
86

Partition List

Partition a linked list such that all nodes less than x come before nodes greater than or equal to x while preserving re…

Medium
88

Merge Sorted Array

Merge two sorted arrays into the first array in non-decreasing order, using a two-pointer approach.

Easy
125

Valid Palindrome

Check if a given string is a valid palindrome by using two-pointer scanning and invariant tracking techniques.

Easy
141

Linked List Cycle

Determine if a given linked list contains a cycle using pointer manipulation or hashing, focusing on detecting repeated …

Easy
142

Linked List Cycle II

Identify the start of a cycle in a linked list using pointer manipulation, efficiently handling edge cases without modif…

Medium
143

Reorder List

Reorder List requires careful pointer manipulation in a singly linked list to interleave nodes from the ends without alt…

Medium
148

Sort List

Sort List requires sorting a singly linked list efficiently using pointer manipulation and merge sort for optimal perfor…

Medium
151

Reverse Words in a String

Reverse Words in a String requires reordering words using precise two-pointer scanning with careful space handling for e…

Medium
160

Intersection of Two Linked Lists

Given two linked lists, find the node where they intersect or return null if they do not.

Easy

swap_vertScroll inside the bank to auto-load more

Related Patterns

Two Pointers LeetCode Problems: 182 Solutions