It's been a while since I learn for any interview. Hence, I need to strengthen my knowledge about data structure and algorithm (DSA). This week I learned about Two Pointers.
Two Pointers
The two pointers problem is a problem that can be solved using to indices that can be start from different ends of an array (left-right or start-end) or those can be started together with different pace/speed.
Things that I identify if a problem can be solved using two pointers approach is:
- It's a one-dimensional array
- The array is sorted
I plan to continue learning and trying to understand more problems using this approach from LeetCode.
