~/dsa
problem-solving
Not a solution dump: a curated set of problems with the reasoning that cracks each one. This is how I think when the answer isn't obvious.
- 0
- write-ups
- 0
- distinct patterns
- 0
- topics covered
NeetCode solutions on GitHub ↗ · 3 solved and counting
Trapping Rain Water
HardTwo pointers converging, each bounded by its running max
ArraysTwo PointersDynamic ProgrammingGroup Anagrams
MediumBucket by a canonical key that all anagrams share
ArraysHash TableStrings3Sum
MediumSort, fix one element, then two pointers on the rest
ArraysTwo PointersSortingLongest Substring Without Repeating Characters
MediumSliding window with a last-seen index map; jump the left bound past the duplicate
StringsSliding WindowHash MapDaily Temperatures
MediumMonotonic decreasing stack of indices, resolved when a warmer day arrives
ArraysStackMonotonic StackKoko Eating Bananas
MediumBinary search on the answer with a monotonic feasibility check
Binary SearchArraysLRU Cache
MediumHash map for O(1) lookup plus a doubly linked list for O(1) recency reordering
Hash MapLinked ListDesignCourse Schedule
MediumCycle detection in a directed graph via three-color DFS
GraphTopological SortDFSCoin Change
MediumBottom-up unbounded knapsack: dp[a] = fewest coins to make amount a
Dynamic ProgrammingArraysFind Median from Data Stream
HardTwo heaps: a max-heap for the low half, a min-heap for the high half, kept balanced
HeapDesignTwo Heaps