Learn
Better than passive video
Animated classroom
Step-by-step animated dry-runs with Hinglish narration, play/pause and an instant jump into practice. Pause anytime — a video can’t quiz your brain mid-lesson like this. 50 lessons.
Hash mapTwo Sum — Hash Map WalkYouTube-style dry run: watch the map fill, then the hit. 9 beats ~2 minTwo pointersContainer With Most WaterL and R dance — always move the shorter wall. 9 beats ~2 minSliding windowLongest Substring Without RepeatWindow grow with R, shrink with L when duplicate aata hai. 9 beats ~2 minKadaneKadane — Maximum SubarrayRunning sum vs restart — the classic DP one-liner intuition. 9 beats ~2 minTwo pointersMove Zeroes — Write PointerSlow pointer writes non-zeros; rest fill with 0. 9 beats ~2 minTwo pointersBinary Search — Halve the WorldSorted array pe O(log n) — interview ka bread-butter. 9 beats ~2 minArray scanValid Parentheses — Stack StoryOpen push, close match-top. Empty at end = valid. 9 beats ~2 minHash mapContains Duplicate — Set WalkHave I seen this value before? Set answers instantly. 10 beats ~2 minArray scanBest Time to Buy & Sell — Min So FarTrack cheapest buy behind you; profit = price − minSoFar. 10 beats ~2 minArray scanPlus One — Carry from the RightWalk digits right-to-left; handle the all-nines case. 9 beats ~2 minArray scanRotate Array — Triple Reversek %= n; reverse all, reverse first k, reverse rest. 9 beats ~2 minTwo pointersValid Palindrome — Two PointersSkip junk, compare lowercased ends, walk inward. 9 beats ~2 minTwo pointers3Sum — Sort + Two PointersFix one index; two-sum the rest; skip duplicates. 9 beats ~2 minHash mapGroup Anagrams — Sorted KeyAnagrams share a sorted signature. Map key → list. 9 beats ~2 minHash mapTop K Frequent — Bucket SortCount, then bucket by frequency; walk high→low. 9 beats ~2 minTwo pointersRemove Duplicates — Write PointerSorted array: slow writer keeps unique prefix. 9 beats ~2 minSliding windowMax Average Subarray — Fixed WindowSum of k, slide: add right, drop left, track max. 9 beats ~2 minSliding windowMinimum Window SubstringExpand until valid, shrink while valid, track best. 9 beats ~2 minSliding windowPermutation in String — Fixed WindowWindow of len(s1); match counts while sliding. 9 beats ~2 minArray scanMissing Number — Sum / XORn(n+1)/2 minus sum, or XOR all indexes and values. 9 beats ~2 minArray scanSingle Number — XOR WalkPairs cancel to zero; the lonely value remains. 9 beats ~2 minArray scanMajority Element — Boyer-MooreCandidate + count; the majority always survives. 9 beats ~2 minTwo pointersMerge Sorted Array — Fill from BackThree pointers; write the larger value at the end. 9 beats ~2 minTwo pointersSort Colors — Dutch National Flaglo / mid / hi one-pass partition of 0,1,2. 9 beats ~2 minArray scanProduct Except Self — Prefix × SuffixLeft products into ans, then multiply running right. 9 beats ~2 minHash mapFirst Unique Character — Count then ScanFrequency pass, then first index with count 1. 9 beats ~2 minHash mapIsomorphic Strings — Bijection MapMap s→t and ensure no two letters claim the same t. 9 beats ~2 minHash mapHappy Number — Digit Square CycleSum of digit squares; detect cycles with a set. 9 beats ~2 minHash mapLongest Consecutive — Set StreaksOnly start a run when x-1 is missing; count upward. 9 beats ~2 minTwo pointersTwo Sum II — Sorted Two PointersL/R from ends; move by comparing sum to target. 9 beats ~2 minTwo pointersSquares of Sorted Array — Merge EndsCompare abs ends; place larger square from the back. 9 beats ~2 minTwo pointersTrapping Rain Water — Two MaxesWater at i = min(leftMax,rightMax) − height[i]. 9 beats ~2 minSliding windowFind All Anagrams — Sliding CountsFixed window of |p|; record start index on match. 9 beats ~2 minArray scanValid Parentheses — Stack StoryPush opens; on close, top must match; empty at end. 9 beats ~2 minArray scanDaily Temperatures — Monotonic StackStack of decreasing indexes; pop when a warmer day arrives. 9 beats ~2 minArray scanReverse Linked List — Three Pointersprev, cur, next — flip each link as you walk. 9 beats ~2 minArray scanMerge Two Sorted Lists — Dummy HeadAlways attach the smaller head; stitch leftovers. 9 beats ~2 minTwo pointersLinked List Cycle — FloydSlow +1, fast +2; if they meet, there is a cycle. 9 beats ~2 minArray scanInvert Binary Tree — Swap KidsSwap left and right recursively (or via BFS). 9 beats ~2 minArray scanMax Depth of Tree — Recurse Heightsdepth = 1 + max(leftDepth, rightDepth). 9 beats ~2 minArray scanSame Tree — Structural RecursionBoth null OK; values match and both subtrees match. 9 beats ~2 minKadaneClimb Stairs — Fibonacci DPways(n) = ways(n-1) + ways(n-2). 9 beats ~2 minKadaneHouse Robber — Skip Adjacentdp[i] = max(dp[i-1], dp[i-2] + nums[i]). 9 beats ~2 minKadaneCoin Change — Unbounded Knapsack DPdp[x] = min coins to make amount x; try each coin. 9 beats ~2 minHash mapIntersection of Two Arrays II — Freq MapCount one array; consume counts while walking the other. 9 beats ~2 minArray scanMax Consecutive Ones — Streak Countercur++ on 1, reset on 0; track the max. 9 beats ~2 minTwo pointersSearch Insert Position — Lower BoundBinary search the first index where nums[i] ≥ target. 9 beats ~2 minTwo pointersFirst & Last Position — Twin BoundsLower bound for first; upper bound − 1 for last. 9 beats ~2 minArray scanMin Stack — Twin StacksValue stack + mins stack; push and pop together. 9 beats ~2 minSliding windowMax Consecutive Ones III — Flip ≤ k ZerosLongest window that contains at most k zeros. 9 beats ~2 min
Prefer reading? C++ Fundamentals · DSA lessons