Revisiting LeetCode problems with focus on patterns and intuition

✅ LeetCode Top 150 – Day 43 | Revision Day Today was all about reinforcing fundamentals and strengthening problem-solving intuition. I revisited 3 problems across difficulty levels and focused on patterns + intuition rather than just code. 🍬 1. Candy (Hard) Key Takeaways: Classic greedy + two-pass problem Maintain fairness by checking left → right and then right → left When values increase, give more; when values decrease, adjust backwards Intuition: Local constraints + global minimum 📌 Learning: Greedy isn't always one-directional — sometimes symmetry is the key. 💧 2. Trapping Rain Water (Hard) Key Takeaways: Key insight: Water trapped depends on min(maxLeft, maxRight) Approaches: Prefix-suffix arrays (O(n) space) Two-pointer optimal approach (O(1) space) Great example of thinking in constraints, not brute force 📌 Learning: Recognize patterns where global boundaries influence local results. 🏛️ 3. Roman to Integer (Easy) Key Takeaways: Understand subtraction rule: If current < next → subtract else add Efficient use of mapping Good revision of string traversal + conditional logic 📌 Learning: Small problems build intuition for bigger greedy patterns. #LeetCode #dsa #coding #softwareengineering #leetcode150 #learningjourney #consistencyWins

To view or add a comment, sign in

Explore content categories