35/35
- DSA 7 minArrays and Strings
Why contiguity is the whole advantage, and what it costs when you insert in the middle.
- DSA 8 minBacktracking
Trying every possibility without trying every possibility — how one rejection prunes a whole branch.
- DSA 8 minBinary Search
Why halving beats scanning, and the one sentence that has to stay true for the loop to be correct.
- DSA 7 minBit Manipulation
What integers actually look like in memory, and the handful of tricks worth memorising.
- DSA 5 min easyCan Place Flowers
Plant as early as possible — and the function that quietly rewrites its caller's garden.
- DSA 6 min easyConcatenation of Array
A three-line problem that is really about Go slices — capacity, copying, and who owns the array.
- DSA 6 min easyContains Duplicate
The first problem where a set beats a nested loop — and what Go uses for a set.
- DSA 9 minDynamic Programming
Recursion that stops repeating itself — and how to find the state that makes it work.
- DSA 9 minGraphs and Shortest Paths
Four algorithms, and the one property of your graph that decides which of them is allowed.
- DSA 8 minGreedy
Take the best option in front of you — and the proof you owe before you are allowed to.
- DSA 6 min mediumGroup Anagrams
A canonical key turns grouping into one map insert — and Go lets the key be an array.
- DSA 8 minHash Maps
Why average O(1) is a statement about spread, and what happens when the spread fails.
- DSA 7 minHeaps and Priority Queues
A tree hidden inside an array, and why knowing less is cheaper than knowing everything.
- DSA 6 min easyIs Subsequence
Two pointers that only move forward — and the byte-versus-rune slip that crashes it.
- DSA 6 min easyIsomorphic Strings
A consistent one-to-one substitution — and why checking one direction is not enough.
- DSA 4 min easyLength of Last Word
Two lines with the standard library, or one backwards scan — and why the trailing space is the whole problem.
- DSA 7 minLinked Lists
Pointer surgery without losing the list, and the dummy node that removes every edge case.
- DSA 5 min easyLongest Common Prefix
Compare down the columns, not along the words — and stop at the first disagreement.
- DSA 6 min easyMajority Element
Boyer-Moore voting — constant space, and only correct because the problem promises something.
- DSA 7 minMatrix Traversal
Grids are graphs with invisible edges — and the direction array that keeps the code honest.
- DSA 8 minMerge Sort
Divide until trivial, then merge — and why the recursion tree gives you the running time for free.
- DSA 7 minMerging Intervals
Sort by start, sweep once — and the off-by-one that decides whether touching ranges count.
- DSA 8 min easyNext Greater Element
How a monotonic stack turns a quadratic scan into one pass, and why the stack can never stop being decreasing.
- DSA 5 min easyPascal's Triangle
Each row from the one above it — the smallest dynamic programming table there is.
- DSA 5 min easyRemove Element
Removing in place without shifting — one boundary, one pass, and what the return value really is.
- DSA 5 min easyReplace Elements with Greatest Element on Right Side
Walk backwards and the quadratic scan disappears — the smallest suffix-aggregate problem.
- DSA 7 minSliding Window
Why the window never moves backwards, and how that turns a quadratic scan linear.
- DSA 6 minStacks and Queues
Two rules for "what next", and why the choice changes which order you explore.
- DSA 7 minTwo Pointers
One pass instead of two loops, and the ordering property that makes discarding safe.
- DSA 7 minUnion-Find
Keeping track of who is connected to whom, and the two one-line tricks that make it nearly free.
- DSA 4 min easyUnique Email Addresses
Normalise, then count the set — and the one part of the address you must not touch.
- DSA 7 min easyValid Anagram
One tally instead of two — and the Unicode bug hiding in the obvious Go solution.
Coverage
35 of 35 problems- Arrays and strings ↗
- Length of last word ↗
- Longest common prefix ↗
- Remove element ↗
- Replace elements ↗
- Pascal's triangle ↗
- Majority element ↗
- Concatenation of array ↗
- Two pointers ↗
- Is subsequence ↗
- Sliding window ↗
- Binary search ↗
- Sorting ↗
- Linked lists ↗
- Stacks and queues ↗
- Monotonic stack ↗
- Hash maps ↗
- Two sum ↗
- Group anagrams ↗
- Unique email addresses ↗
- Isomorphic strings ↗
- Contains duplicate ↗
- Valid anagram ↗
- Heaps and priority queues ↗
- Trees and traversals ↗
- Tries ↗
- Graphs and shortest paths ↗
- Union-find ↗
- Backtracking ↗
- Greedy ↗
- Can place flowers ↗
- Dynamic programming ↗
- Intervals ↗
- Bit manipulation ↗
- Matrix traversal ↗