feat: add 14 missing high-yield DSA problems - #537
Conversation
Add 14 carefully curated problems across 6 underrepresented patterns: Monotonic Stack (2 -> 5 problems): - seanprashad#496 Next Greater Element I (Easy) - canonical NGE entry point - #739 Daily Temperatures (Medium) - the definitive monotonic stack problem - seanprashad#84 Largest Rectangle in Histogram (Hard) - critical FAANG interview problem Binary Search on Answer Space (0 -> 3 problems): - #875 Koko Eating Bananas (Medium) - entry point for binary search on answer paradigm - #1011 Capacity To Ship Packages Within D Days (Medium) - generalizes the pattern - seanprashad#410 Split Array Largest Sum (Hard) - hard-level application of the same paradigm Multi-Source BFS (0 -> 2 problems): - #994 Rotting Oranges (Medium) - canonical multi-source BFS on a grid - seanprashad#542 01 Matrix (Medium) - BFS from all 0s simultaneously Prefix Sum + Hash Map (0 -> 2 problems): - #560 Subarray Sum Equals K (Medium) - most important prefix sum + hash map problem - #974 Subarray Sums Divisible by K (Medium) - extends #560 with modular arithmetic Union-Find as primary solution (0 -> 2 problems): - #684 Redundant Connection (Medium) - DSU is the intended tool here - #547 Number of Provinces (Medium) - clean DSU entry point DP gap-fillers (2 problems): - seanprashad#72 Edit Distance (Medium) - most famous string DP, distinct from LCS - seanprashad#518 Coin Change II (Medium) - unbounded knapsack (ways), pairs with seanprashad#322 (min coins)
|
Note: company frequency data is estimated since I don't have a LeetCode session token to run the update script. Happy for maintainers to run |
There was a problem hiding this comment.
Pull request overview
Adds 14 interview-prep “high-yield” LeetCode problems into the repository’s central question dataset to better cover several missing patterns (Monotonic Stack, binary search on answer space, multi-source BFS, prefix-sum hash map, DSU, and a couple DP staples).
Changes:
- Appended 14 new question entries (ids: 496, 739, 84, 875, 1011, 410, 994, 542, 560, 974, 684, 547, 72, 518) with patterns, difficulty, and company frequency metadata.
- Updated the dataset
updatedtimestamp value. - Changed two tag strings to use a literal en dash character instead of the JSON escape sequence.
Suppressed comments (1)
src/data/questions.json:7331
- Same issue as above: switching from
\u2013to a literal en dash will be undone by thecron/update_questions.pymetadata writer (defaultjson.dumpescapes non-ASCII), causing recurring diffs. Prefer a representation that matches the generator, or update the generator to keep Unicode characters unescaped.
"Array",
"String",
"Trie",
"Sorting",
"Aho–Corasick Algorithm"
],
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -1,5 +1,5 @@ | |||
| { | |||
| "updated": "2026-08-16T13:14:18.780633", | |||
| "updated": "2026-08-20T15:18:30.805Z", | |||
| "Sorting", | ||
| "Counting", | ||
| "Boyer\u2013Moore Majority Vote Algorithm" | ||
| "Boyer–Moore Majority Vote Algorithm" | ||
| ], |
| { | ||
| "id": 518, | ||
| "title": "Coin Change II", | ||
| "slug": "coin-change-2", |
There was a problem hiding this comment.
Is this the correct slug? Based on the question URL, I don't think so: https://leetcode.com/problems/coin-change-ii/description/
There was a problem hiding this comment.
You're right, my mistake! The correct slug should be coin-change-ii to match the URL. Fixed and pushed — sorry about that!
|
Thanks, I'll look to add these questions in the future after I vet them |
Description:
Hey! I've been using this repo to prep for interviews and noticed some patterns that I felt were important but had very few (or zero) problems. So I went through the list carefully and added 14 problems that I think fill real gaps.
I tried not to add random problems — each one is there for a specific reason.
Monotonic Stack — only had 2 problems, and honestly neither of them really teaches the pattern cleanly. Added the 3 problems that every resource (NeetCode, TUF, etc.) uses to explain it:
#496 Next Greater Element I
#739 Daily Temperatures
#84 Largest Rectangle in Histogram
Binary Search on Answer Space — the existing 18 binary search problems all search in a sorted array. This is a completely different idea where you binary search on the answer itself using a feasible() check. Added 3 problems for this:
#875 Koko Eating Bananas
#1011 Capacity To Ship Packages Within D Days
#410 Split Array Largest Sum
Multi-Source BFS — all existing BFS problems start from one node. Multi-source BFS (starting from multiple cells at once) is a separate trick that comes up a lot in grid problems. Added:
#994 Rotting Oranges
#542 01 Matrix
Prefix Sum + Hash Map — the classic O(n) subarray technique using prefixSum[j] - prefixSum[i] = k wasn't represented at all. Added:
#560 Subarray Sum Equals K
#974 Subarray Sums Divisible by K
Union-Find — the 4 existing Union-Find problems are all also tagged BFS/DFS. Added 2 where DSU is clearly the right tool:
#684 Redundant Connection
#547 Number of Provinces
DP — two sub-types were missing despite the big DP section:
#72 Edit Distance (string DP — different recurrence than LCS which is already there)
#518 Coin Change II (number of ways, vs #322 which finds minimum count)