Mar 16 · 4 min read · Sliding Window Technique When solving array or string problems in competitive programming, we often deal with subarrays or substrings. A naive solution usually checks every possible subarray, which le
Join discussion
Feb 14 · 3 min read · Why Do We Even Need Two Pointers? When we first learn arrays, our brain naturally jumps to nested loops. Want to find a pair?Use two loops. Want to compare elements?Two loops. Works? Yes.Efficient? Not really. If an array has 10,000 elements, O(n²) m...
Join discussion
Feb 13 · 1 min read · https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/description/ Array is sorted Return 1-based indices Exactly one solution guaranteed Core Idea (Two Pointer Technique) Use two pointers: left → start of array right → end of array ...
Join discussionJan 8 · 2 min read · 🗓️ Date: January 9, 2026📌 Challenge:🧩 Problem: Intersection of Two Linked Lists – LeetCode #160 (Easy)💻 Topic: Two Pointer, Linked List ✅ Problem Statement (Summary): Goal: Given the heads of two singly linked lists headA and headB, return the n...
Join discussion
Dec 22, 2025 · 8 min read · I remember the first time I encountered the two-pointer technique in my Data Structures class. My professor threw this problem at us: "Find two numbers in a sorted array that add up to a target." My immediate thought? "Easy! Just use two loops and ch...
Join discussion
Dec 16, 2025 · 2 min read · Problem: https://leetcode.com/problems/check-if-string-is-a-prefix-of-array/description/ Code: class Solution: def isPrefixString(self, s: str, words: List[str]) -> bool: index=0 for word in words: if not s.startswith(...
Join discussionNov 25, 2025 · 2 min read · Hey Coders, Today we are going to understand and solve the Boats to Save People problem from LeetCode. Problem: we are given an array consisting of people’s weights , limit (capacity of a boat)and asked to find the minimum number of boats required. C...
Join discussionNov 11, 2025 · 2 min read · Today marks the seventh day of my journey into mastering Data Structures and Algorithms (DSA). I delved into the intriguing world of the two-pointer pattern, a versatile technique often used to solve array and string problems efficiently. By tackling...
Join discussion