Opening your learning path
Progress is saved as you study.
Opening your learning path
Progress is saved as you study.
The Two Pointers pattern applies when you need fast-slow, converging, expanding from center, and in-place modification techniques. Its time complexity is O(n) for a single linear pass; O(n²) for centre-expansion variants (e.g. palindrome checks) and space complexity O(1). It is used in 34 problems on Thita, including Backspace String Compare, Boats to Save People and Container With Most Water. Common variations are String Comparison with Backspaces and String Reversal.
Master the two pointers technique including fast-slow pointers, converging pointers, and expanding from center. Essential for array, string, and linked list problems in coding interviews.
Two Pointers is pattern 1 of 16 in the Thita.ai DSA course. It covers fast-slow, converging, expanding from center, and in-place modification techniques, split into 7 subpatterns and about 3 hours of study. It is one of the interview-critical patterns, so it is worth covering before your first onsite.
Each subpattern below has its own theory page and problem set. They are listed in the order the course teaches them.
Read the theory for a subpattern, then solve its problems in the browser editor. Your solution runs against the problem's test cases, and the AI coach gives a hint on the technique you are missing rather than the finished answer. Progress is tracked per subpattern, so the tracker shows which of the 7 Two Pointers subpatterns you have covered. Topics covered here include two pointers, two pointer technique, fast slow pointers, converging pointers, floyd cycle detection, two sum, three sum, palindrome check.