Author at RahulBlogs
The intersection of two arrays requires fast lookup and no duplicates in the result. A hash map gives you both in one structure. Here is the full breakdown with dry run, edge cases, and interview tips.
Counting consecutive ones is not about totals. It is about streaks. And the hardest part is not resetting when you hit a zero: it is remembering to finalize the streak when the array ends. Full breakdown inside.
When the window size is fixed, you never need to recompute the sum from scratch. Add one element, remove one element, keep sliding. Here is the full breakdown of the fixed-window sliding technique.
Water does not care about its neighbors. It cares about boundaries. Once you understand that, the prefix max approach becomes obvious. Full dry run, complexity analysis, and interview tips inside.
You do not need to check every buy-sell pair. One pass, two variables, and the right greedy instinct is all it takes. Here is the full breakdown of LeetCode 121 with a deep dry run and interview tips.
What if you could find the majority element without counting anything? The Boyer-Moore Voting Algorithm does exactly that, in O(n) time and O(1) space. Here is the full breakdown.
Low Level Design is one of the most important skills for modern software engineers. This detailed guide explains design patterns, UML relationships, aggregation vs composition, object interactions, interview strategies, and how to think like a senior engineer while designing scalable systems.
Squaring a sorted array breaks its order. Learn how the two pointer technique rebuilds sorted squares in a single O(n) pass, with a full dry run, common mistakes, and interview tips.
On Day 5 of the 250 Days DSA Challenge, we crack LeetCode 75 Sort Colors using the Dutch National Flag algorithm. One pass. Three pointers. Zero extra space. Here is exactly how it works and why every pointer decision matters.
Day 4 of the 250 Days DSA Challenge. LeetCode 11 Container With Most Water is a visual problem hiding a clean logical constraint. This post breaks down the full approach with a detailed dry run, pointer movement reasoning, and interview ready insights.
Day 3 of the 250 Days DSA Challenge. LeetCode 15 Three Sum looks intimidating at first, but once you sort the array and fix one element, it reduces to the exact same Two Sum II problem we solved yesterday. This post breaks down the full approach with a detailed dry run.
Day 2 of the 250 Days DSA Challenge. LeetCode 167 Two Sum II looks like a simple sum problem, but the sorted array changes everything. This post breaks down the Two Pointers technique with a detailed dry run. Perfect for anyone learning how to think with pointers.
Kicking off a 250-day DSA challenge with LeetCode 283 Move Zeroes. This post breaks down the Fast–Slow Two Pointer technique with a detailed dry run, visual step-by-step walkthrough, and interview-ready insights. Perfect for beginners and anyone revisiting array fundamentals.