Workspace

Two Pointers

3 day streakD
All algorithms
BEGINNER · 3 PRACTICE PROBLEMS

Two Pointers

Two positions. One elegant solution.

Learn the pattern Put it into practice
THE CORE IDEA

Two pointers

Move inward from both ends, or move two pointers at different speeds.

O(n)

A good place to practice

Start simple, then build up to the next challenge.

3 problems
SolvedProblemDifficultyTopicAcceptanceBookmark
3SumMediumTwo Pointers36.6%
Valid PalindromeEasyTwo Pointers50.7%
Container With Most WaterMediumTwo Pointers58.1%

A good place to start

Explore a pattern

A little guidance

Start with a pattern, read through a problem, and mark it solved when the idea clicks. Save anything you want to revisit.

This preview uses sample content. Your bookmarks and solved checkmarks stay in this browser.

Explore the roadmap