Two Pointers
Problems using the two pointers technique
31 lessons
78 min
Lessons
1. What is Two Pointers
Pattern overview
2m
2. Prerequisites
What you need first
1m
3. When to Use
Pattern triggers
2m
4. When NOT to Use
Avoid forcing this pattern
2m
5. LeetCode 125 Valid Palindrome - Problem Statement
The problem
2m1 problems
6. Quiz: Two-Pointer Palindrome Movement
Test your understanding
2m1 problems
7. LeetCode 125 Valid Palindrome - Solution
The core idea
3m
8. LeetCode 125 Valid Palindrome - Example and Complexity Analysis
Walkthrough and analysis
3m
9. LeetCode 125 Valid Palindrome - Implementation
The approach
3m1 problems
10. LeetCode 15 3Sum - Problem Statement
The problem
2m1 problems
11. LeetCode 15 3Sum - Why Naive Fails
The trap
2m
12. LeetCode 15 3Sum - Solution
The core idea
3m
13. LeetCode 15 3Sum - Example and Complexity Analysis
Walkthrough and analysis
3m
14. LeetCode 15 3Sum - Implementation
The approach
4m1 problems
15. LeetCode 11 Container With Most Water - Problem Statement
The problem
2m1 problems
16. LeetCode 11 Container With Most Water - Why Naive Fails
The trap
2m
17. LeetCode 11 Container With Most Water - Solution
The core idea
3m
18. Quiz: Moving the Shorter Pointer
Test your understanding
2m1 problems
19. LeetCode 11 Container With Most Water - Example and Complexity Analysis
Walkthrough and analysis
3m
20. LeetCode 11 Container With Most Water - Implementation
The approach
3m1 problems
21. LeetCode 42 Trapping Rain Water - Problem Statement
The problem
2m1 problems
22. LeetCode 42 Trapping Rain Water - Why Naive Fails
The trap
2m
23. LeetCode 42 Trapping Rain Water - Solution
The core idea
3m
24. LeetCode 42 Trapping Rain Water - Example and Complexity Analysis
Walkthrough and analysis
3m
25. LeetCode 42 Trapping Rain Water - Implementation
The approach
4m1 problems
26. LeetCode 16 3Sum Closest - Problem Statement
The problem
2m1 problems
27. LeetCode 16 3Sum Closest - Solution
The core idea
3m
28. LeetCode 16 3Sum Closest - Example and Complexity Analysis
Walkthrough and analysis
3m
29. LeetCode 16 3Sum Closest - Implementation
The approach
4m1 problems
30. Common Mistakes
What to avoid
2m
31. Section Recap
Summary
1m
Practice Problems
1.
2.
3.
4.