Two pointers problems in Python
Walk a sequence from both ends or at two speeds: the two-pointer technique, on problems with tests.
Beginner
Intermediate
- 62. Pair Sum in a Sorted ListTwo prices that use up the budget exactly60 XP10 min
- 112. Container With the Most WaterPick the two walls that hold the most water90 XP18 min
- 269. Fewest LifeboatsTwo people per boat and a weight limit: how many boats does the ferry need?60 XP12 min
- 292. Three-Colour SortA jumble of three kinds of tokens, put in order in a single sweep65 XP12 min
Advanced
- 123. Overlapping Free TimesTwo busy calendars: when are both people free?115 XP20 min
- 145. Count Possible TrianglesHow many triangles hide in a bag of sticks?135 XP25 min
- 164. Three Numbers That Sum to ZeroEvery trio of numbers that cancels out150 XP30 min
- 362. Three Numbers Closest to a TargetPick three numbers whose total lands as close to the target as possible125 XP25 min
Expert
Other topics
- Python Basics
- Strings
- Lists
- Dictionaries and sets
- Loops
- Functions
- Math
- Sorting and searching
- Sliding window
- Stacks and queues
- Recursion and backtracking
- Dynamic programming
- Greedy
- Graphs
- Trees
- Bit manipulation
- Classes
- Iterators and generators
- Parsing
- Simulation
- Python idioms
- Regular expressions
- Codes and ciphers
- Working with data
- Grids and matrices
- Geometry
- Games and puzzles
- Heaps
- Data structures
Or see every challenge, with study plans, today's challenge and duels.