About This Pattern
Master the Two Pointers pattern by practicing these problems organized by difficulty.Focus on the Key Signals - these are the indicators that tell you when to use this pattern.
Easy (3)
Given a string, determine if it is a palindrome, considering only alphanumeric characters.
Key Signals:
Find the node at which two singly linked lists intersect.
Key Signals:
Given a list of words and two words word1 and word2, return the shortest distance between these two words.
Key Signals:
Medium (4)
Given a sorted array, find two numbers that add up to a target.
Key Signals:
Find the shortest continuous subarray that if sorted, the whole array would be sorted.
Key Signals:
Check if two strings are one edit (insert, delete, or replace) away.
Key Signals:
Compress string by replacing consecutive repeating characters with character + count.
Key Signals:
Hard (1)
Given n non-negative integers representing an elevation map, compute how much water it can trap.
Key Signals: