DEV Community

Yash
Yash

Posted on

Day 2 / 90 – Two Pointer Pattern πŸ” | DSA Journey πŸš€

oday I focused on mastering the Two Pointer Pattern, a powerful technique to optimize brute-force solutions from O(nΒ²) β†’ O(n).

πŸ“Œ What I learned

When & where to use two pointers

Works best with arrays, strings & linear data structures

Helps write clean, efficient interview-ready code

🧠 Problems Solved
βœ… 125. Valid Palindrome
βœ… 344. Reverse String
βœ… 977. Squares of a Sorted Array
βœ… 680. Valid Palindrome II

⏱️ Most solutions achieved O(n) time & O(1) space

Key takeaway: Pattern recognition > memorizing solutions.

On to Day 3 πŸ’ͺ

Day2 #DSA #TwoPointers #CodingJourney #90DaysOfDSA #LeetCode #InterviewPrep

Top comments (0)