diff --git a/src/data/roadmaps/leetcode/content/1-d-dynamic-programming@sRU06JyWqwCnRDYEAV53L.md b/src/data/roadmaps/leetcode/content/1-d-dynamic-programming@sRU06JyWqwCnRDYEAV53L.md new file mode 100644 index 000000000000..5f6090db9b5f --- /dev/null +++ b/src/data/roadmaps/leetcode/content/1-d-dynamic-programming@sRU06JyWqwCnRDYEAV53L.md @@ -0,0 +1,3 @@ +# Stage 13 — 1-D Dynamic Programming + +Dynamic programming is the technique of breaking a problem into overlapping subproblems, solving each once, and storing the result to avoid recomputation. In one-dimensional DP, each state depends only on a fixed number of previous states, so the solution builds a single array from left to right. The first step is always identifying the recurrence: what does the answer at position i depend on? The problems here cover the core DP patterns you will see repeatedly: linear sequences, knapsack decisions, and string segmentation. DP problems are notoriously hard to recognize, and the only reliable way to get better at them is to solve many and study the structure of their recurrences. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/2-d-dynamic-programming@sXyW3ZAURJUze8_g9PvwW.md b/src/data/roadmaps/leetcode/content/2-d-dynamic-programming@sXyW3ZAURJUze8_g9PvwW.md new file mode 100644 index 000000000000..33614cd1a95e --- /dev/null +++ b/src/data/roadmaps/leetcode/content/2-d-dynamic-programming@sXyW3ZAURJUze8_g9PvwW.md @@ -0,0 +1,3 @@ +# Stage 14 — 2-D Dynamic Programming + +Two-dimensional DP extends the same ideas to problems where the state depends on two variables simultaneously, typically two indices into two sequences or two dimensions of a grid. The table is now a matrix, and each cell is filled based on cells above it, to its left, or diagonally adjacent. The problems here include string comparison (edit distance, longest common subsequence), grid path counting, and interval DP where you think about ranges rather than prefixes. These problems tend to be harder to set up than 1-D DP, but once you identify the state and the transition, the code follows directly from the recurrence. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/3sum@yis4-_D0GREukouiRcCwC.md b/src/data/roadmaps/leetcode/content/3sum@yis4-_D0GREukouiRcCwC.md new file mode 100644 index 000000000000..330a4d04fde6 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/3sum@yis4-_D0GREukouiRcCwC.md @@ -0,0 +1,3 @@ +# 3Sum + +Given an array of integers, find all unique triplets that sum to zero. You sort the array first, then for each element use two pointers to find pairs that complete the triplet. The sort plus two pointers bring it from O(n³) to O(n²). This problem teaches you to extend the two pointer technique beyond pairs and introduces how sorting enables smarter traversal. Visit the question on the LeetCode [website](https://leetcode.com/problems/3sum/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/advanced-graphs@jNYQFvR3IafFXbAQHL4bF.md b/src/data/roadmaps/leetcode/content/advanced-graphs@jNYQFvR3IafFXbAQHL4bF.md new file mode 100644 index 000000000000..9e061774917f --- /dev/null +++ b/src/data/roadmaps/leetcode/content/advanced-graphs@jNYQFvR3IafFXbAQHL4bF.md @@ -0,0 +1,3 @@ +# Stage 12 — Advanced Graphs + +Advanced graph problems involve weighted edges, which require more sophisticated algorithms than simple BFS or DFS. Dijkstra's algorithm finds the shortest path in a weighted graph using a min-heap. Prim's and Kruskal's algorithms find the minimum spanning tree, connecting all nodes at minimum total cost. These algorithms are more complex than anything seen so far, and the problems here often combine the algorithm with an additional constraint, such as a limit on the number of steps or a non-standard cost function. Understanding the conditions under which each algorithm applies is as important as knowing how to implement it. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/arrays--hashing@C4M0XfOtB9_Q8srAJU__A.md b/src/data/roadmaps/leetcode/content/arrays--hashing@C4M0XfOtB9_Q8srAJU__A.md new file mode 100644 index 000000000000..79749d1b9df4 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/arrays--hashing@C4M0XfOtB9_Q8srAJU__A.md @@ -0,0 +1,3 @@ +# Stage 1 — Arrays & Hashing + +Arrays and hash maps are the building blocks of almost every algorithm problem. Before learning any pattern, you need to be comfortable navigating an array and reaching for a hash map when you need fast lookups. Most problems in this stage are solved in one or two passes, and the main skill you are developing is recognizing when a hash map can replace a nested loop. If you find yourself thinking about checking membership or counting frequencies, a hash map is almost always the right tool. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/backtracking@gEZFGJPq0JFjpRwl3z3XK.md b/src/data/roadmaps/leetcode/content/backtracking@gEZFGJPq0JFjpRwl3z3XK.md new file mode 100644 index 000000000000..b957c127f161 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/backtracking@gEZFGJPq0JFjpRwl3z3XK.md @@ -0,0 +1,3 @@ +# Stage 9 — Backtracking + +Backtracking is a systematic way to explore all possible solutions by making a choice, recursing, and undoing the choice when you backtrack. It is the right tool for problems that ask for all combinations, all permutations, all subsets, or any valid configuration. The key skill is recognizing when to prune: stopping a branch early when you can tell it cannot lead to a valid solution. Without pruning, backtracking is just brute force. Most problems here share the same recursive skeleton and differ only in the constraints that determine valid choices and stopping conditions. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/best-time-to-buy-and-sell@K7qTp-hRmxxVLYvr4ftr7.md b/src/data/roadmaps/leetcode/content/best-time-to-buy-and-sell@K7qTp-hRmxxVLYvr4ftr7.md new file mode 100644 index 000000000000..e0d130c27a2a --- /dev/null +++ b/src/data/roadmaps/leetcode/content/best-time-to-buy-and-sell@K7qTp-hRmxxVLYvr4ftr7.md @@ -0,0 +1,3 @@ +# Best Time to Buy and Sell Stock + +Given an array of daily stock prices, find the maximum profit from one buy and one sell. You track the minimum price seen so far and the best profit achievable at each step using a single pass. This is the simplest sliding window problem since the window always expands from the current day, and it teaches you how to track a running minimum and maximum simultaneously. Visit the question on the LeetCode [website](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/binary-search@OkNQABVymkpxvHE7gVids.md b/src/data/roadmaps/leetcode/content/binary-search@OkNQABVymkpxvHE7gVids.md new file mode 100644 index 000000000000..44132ce8b008 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/binary-search@OkNQABVymkpxvHE7gVids.md @@ -0,0 +1,3 @@ +# Stage 4 — Binary Search + +Binary search is not just for finding an element in a sorted array. It is a general technique for eliminating half the search space at each step, and it applies whenever you can define a condition that splits possible answers into a valid half and an invalid half. The problems in this stage move from the textbook version to more creative applications: searching in rotated arrays, and binary searching on the answer itself rather than on the input. Getting binary search right under pressure, with correct boundary conditions, is a skill that requires deliberate practice. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/binary-search@kxvOWb6wyF8GWarP6jrqK.md b/src/data/roadmaps/leetcode/content/binary-search@kxvOWb6wyF8GWarP6jrqK.md new file mode 100644 index 000000000000..03c1b08deaf3 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/binary-search@kxvOWb6wyF8GWarP6jrqK.md @@ -0,0 +1,3 @@ +# Binary Search + +Given a sorted array and a target, return the index of the target or -1 if not found. You repeatedly halve the search space by comparing the middle element to the target. This is the simplest form of binary search and the one you must be able to write without mistakes before moving to harder variants. Visit the question on the LeetCode [website](https://leetcode.com/problems/binary-search/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/binary-tree-level-order@7ac9oA-reXh7xFHj3LRX0.md b/src/data/roadmaps/leetcode/content/binary-tree-level-order@7ac9oA-reXh7xFHj3LRX0.md new file mode 100644 index 000000000000..8901d5294738 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/binary-tree-level-order@7ac9oA-reXh7xFHj3LRX0.md @@ -0,0 +1,3 @@ +# Binary Tree Level Order Traversal + +Given a binary tree, return its node values level by level. You use a queue to process all nodes at one level before moving to the next, collecting each level into its own list. This is the entry point for tree BFS and teaches you the queue-based level tracking pattern that applies to many tree and graph problems. Visit the question on the LeetCode [website](https://leetcode.com/problems/binary-tree-level-order-traversal/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/binary-tree-maximum-path-sum@5htwCuI4Dz_G2ar1enQZv.md b/src/data/roadmaps/leetcode/content/binary-tree-maximum-path-sum@5htwCuI4Dz_G2ar1enQZv.md new file mode 100644 index 000000000000..2708ec01a33b --- /dev/null +++ b/src/data/roadmaps/leetcode/content/binary-tree-maximum-path-sum@5htwCuI4Dz_G2ar1enQZv.md @@ -0,0 +1,3 @@ +# Binary Tree Maximum Path Sum + +Given a binary tree where nodes can have negative values, find the maximum sum of any path between any two nodes. At each node you decide whether to extend either child's path or start fresh, tracking the global maximum as you go. This is one of the hardest tree DFS problems and teaches you to separate what you return up the recursion from what you record as your answer. Visit the question on the LeetCode [website](https://leetcode.com/problems/binary-tree-maximum-path-sum/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/bit-manipulation@VIXFdmkwl9vw6LyxxoT74.md b/src/data/roadmaps/leetcode/content/bit-manipulation@VIXFdmkwl9vw6LyxxoT74.md new file mode 100644 index 000000000000..0bddb052e172 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/bit-manipulation@VIXFdmkwl9vw6LyxxoT74.md @@ -0,0 +1,3 @@ +# Stage 17 — Bit Manipulation + +Bit manipulation uses the binary representation of integers directly through bitwise operators: AND, OR, XOR, and shifts. It is useful for problems involving pairs, uniqueness, flags, or any situation where you need to extract or toggle individual bits. XOR is particularly powerful because it is its own inverse: XOR-ing a value twice cancels out. The problems here are mostly short, but they require a different way of thinking about numbers. Once you internalize the basic bit operations, you will start seeing where they can replace more expensive data structures in problems across other categories. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/burst-balloons@ImPbL26vNvxvPm4Kg5Vpl.md b/src/data/roadmaps/leetcode/content/burst-balloons@ImPbL26vNvxvPm4Kg5Vpl.md new file mode 100644 index 000000000000..547c87f18326 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/burst-balloons@ImPbL26vNvxvPm4Kg5Vpl.md @@ -0,0 +1,3 @@ +# Burst Balloons + +Given an array of balloons with values, burst all of them to maximize coins, where bursting a balloon gives coins equal to the product of itself and its neighbors. You use interval DP: instead of choosing which balloon to burst first, you choose which to burst last within each interval. This problem teaches you that sometimes reversing the order of decisions makes the DP structure cleaner. Visit the question on the LeetCode [website](https://leetcode.com/problems/burst-balloons/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/c@IWmq4UFB5j6O3UJfarh1u.md b/src/data/roadmaps/leetcode/content/c@IWmq4UFB5j6O3UJfarh1u.md new file mode 100644 index 000000000000..04cd229ca67d --- /dev/null +++ b/src/data/roadmaps/leetcode/content/c@IWmq4UFB5j6O3UJfarh1u.md @@ -0,0 +1,3 @@ +# C++ + +C++ is the language of choice for competitive programmers and is common in companies where raw performance matters, such as systems, gaming, or high-frequency trading. It has the fastest execution time of any commonly used interview language and gives you direct access to the standard template library, which includes a heap, set, map, and many other useful structures. The tradeoff is verbosity and the overhead of managing memory manually in some cases. If you are already proficient in C++, it is an excellent interview language. If you are starting from scratch, the learning curve is steep. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/character-replacement@aLQVocF91X1-IrTP7Vb_b.md b/src/data/roadmaps/leetcode/content/character-replacement@aLQVocF91X1-IrTP7Vb_b.md new file mode 100644 index 000000000000..cdb092b2efd4 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/character-replacement@aLQVocF91X1-IrTP7Vb_b.md @@ -0,0 +1,3 @@ +# Longest Repeating Character Replacement + +Given a string and a number k, find the length of the longest substring where you can replace at most k characters to make all characters the same. You track the count of the most frequent character in the window, and if the window size minus that count exceeds k, you shrink from the left. This problem teaches you a clever invariant: you never need to shrink the window below its maximum size seen so far. Visit the question on the LeetCode [website](https://leetcode.com/problems/longest-repeating-character-replacement/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/cheapest-flights-within-k-stops@ijY7CmX7wD5uP_6WwO97H.md b/src/data/roadmaps/leetcode/content/cheapest-flights-within-k-stops@ijY7CmX7wD5uP_6WwO97H.md new file mode 100644 index 000000000000..dffd638aa17d --- /dev/null +++ b/src/data/roadmaps/leetcode/content/cheapest-flights-within-k-stops@ijY7CmX7wD5uP_6WwO97H.md @@ -0,0 +1,3 @@ +# Cheapest Flights Within K Stops + +Given a graph of flights with prices, find the cheapest route from source to destination using at most k stops. This is a modified Dijkstra or Bellman-Ford problem where the constraint is on the number of edges, not just total cost. This problem teaches you how to add an extra dimension (number of steps) to a shortest path algorithm. Visit the question on the LeetCode [website](https://leetcode.com/problems/cheapest-flights-within-k-stops/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/climbing-stairs@bXcvRnpO1aVN8XLLTSghB.md b/src/data/roadmaps/leetcode/content/climbing-stairs@bXcvRnpO1aVN8XLLTSghB.md new file mode 100644 index 000000000000..61a55de46d18 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/climbing-stairs@bXcvRnpO1aVN8XLLTSghB.md @@ -0,0 +1,3 @@ +# Climbing Stairs + +You can climb one or two steps at a time. Find the number of distinct ways to reach the top of n stairs. The number of ways to reach step n is the sum of ways to reach n-1 and n-2, which is exactly the Fibonacci pattern. This is the entry point to DP and teaches you to see a problem as a recurrence: the answer at each state depends on previous states. Visit the question on the LeetCode [website](https://leetcode.com/problems/climbing-stairs/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/clone-graph@WO238sUhvIiZHdLF6Kmfl.md b/src/data/roadmaps/leetcode/content/clone-graph@WO238sUhvIiZHdLF6Kmfl.md new file mode 100644 index 000000000000..4ba52a6ca283 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/clone-graph@WO238sUhvIiZHdLF6Kmfl.md @@ -0,0 +1,3 @@ +# Clone Graph + +Given a connected undirected graph, return a deep copy of it. You use DFS or BFS and a hash map to track which nodes have already been cloned, so you do not create duplicate copies when revisiting nodes. This problem teaches you to handle graphs with cycles during traversal, which requires tracking visited nodes from the start. Visit the question on the LeetCode [website](https://leetcode.com/problems/clone-graph/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/coin-change@WtOHLWoHNkE9JdxtmBlwC.md b/src/data/roadmaps/leetcode/content/coin-change@WtOHLWoHNkE9JdxtmBlwC.md new file mode 100644 index 000000000000..570597a47af9 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/coin-change@WtOHLWoHNkE9JdxtmBlwC.md @@ -0,0 +1,3 @@ +# Coin Change + +Given coin denominations and a target amount, find the minimum number of coins needed. You build a DP table where each amount stores the fewest coins to make it, using each coin to update future amounts. This is the canonical unbounded knapsack problem and teaches you bottom-up DP where you iterate over amounts rather than items. Visit the question on the LeetCode [website](https://leetcode.com/problems/coin-change/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/combination-sum@P0ODrjdYJGSHvn02sjWIe.md b/src/data/roadmaps/leetcode/content/combination-sum@P0ODrjdYJGSHvn02sjWIe.md new file mode 100644 index 000000000000..07f4475e99f2 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/combination-sum@P0ODrjdYJGSHvn02sjWIe.md @@ -0,0 +1,3 @@ +# Combination Sum + +Given an array of distinct integers and a target, return all unique combinations that sum to the target, where each number can be used unlimited times. You use backtracking, and at each step either reuse the current number or move to the next. This problem teaches you how to allow repetition in backtracking by staying at the same index instead of advancing. Visit the question on the LeetCode [website](https://leetcode.com/problems/combination-sum/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/container-with-most-water@YxfJQl5bHYnhryt9RooV0.md b/src/data/roadmaps/leetcode/content/container-with-most-water@YxfJQl5bHYnhryt9RooV0.md new file mode 100644 index 000000000000..1ca201f69529 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/container-with-most-water@YxfJQl5bHYnhryt9RooV0.md @@ -0,0 +1,3 @@ +# Container With Most Water + +Given an array of bar heights, find two bars that together with the x-axis form a container holding the most water. You start with the widest possible container and move the pointer on the shorter side inward, since that is the only move that could increase the area. This problem teaches the key insight that moving the longer side never helps, which is a non-obvious greedy choice that the two pointer pattern makes visible. Visit the question on the LeetCode [website](https://leetcode.com/problems/container-with-most-water/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/contains-duplicate@_wCmBewDz7Qb21u8HSZtp.md b/src/data/roadmaps/leetcode/content/contains-duplicate@_wCmBewDz7Qb21u8HSZtp.md new file mode 100644 index 000000000000..d8dd1e09691f --- /dev/null +++ b/src/data/roadmaps/leetcode/content/contains-duplicate@_wCmBewDz7Qb21u8HSZtp.md @@ -0,0 +1,3 @@ +# Contains Duplicate + +Given an array, return true if any value appears more than once. The brute force compares every pair, but a hash set lets you check for duplicates in a single pass. Simple as it sounds, this problem is your first introduction to using a set for O(1) membership checks, a pattern you will see in almost every stage. Visit the question on the LeetCode [website](https://leetcode.com/problems/contains-duplicate/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/counting-bits@jZscKonByp5QDMcXUA50W.md b/src/data/roadmaps/leetcode/content/counting-bits@jZscKonByp5QDMcXUA50W.md new file mode 100644 index 000000000000..9d66f4601caa --- /dev/null +++ b/src/data/roadmaps/leetcode/content/counting-bits@jZscKonByp5QDMcXUA50W.md @@ -0,0 +1,3 @@ +# Counting Bits + +Given an integer n, return an array where each element is the number of 1 bits in its binary representation from 0 to n. You can use DP: the number of bits in i equals one plus the bits in i with its lowest set bit removed. This problem teaches you to combine bit manipulation with DP to avoid recomputing from scratch for each number. Visit the question on the LeetCode [website](https://leetcode.com/problems/counting-bits/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/course-schedule@CLOI_M9A3D1UFavCYKCSE.md b/src/data/roadmaps/leetcode/content/course-schedule@CLOI_M9A3D1UFavCYKCSE.md new file mode 100644 index 000000000000..3ae9fdedc721 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/course-schedule@CLOI_M9A3D1UFavCYKCSE.md @@ -0,0 +1,3 @@ +# Course Schedule + +Given a list of courses and prerequisites, determine if it is possible to finish all courses. This is a cycle detection problem in a directed graph: if any cycle exists, the schedule is impossible. You can solve it with DFS by tracking nodes in the current recursion path. This problem teaches you topological sort thinking and is a gateway to all dependency-based graph problems. Visit the question on the LeetCode [website](https://leetcode.com/problems/course-schedule/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/daily-temperatures@pMCIlFk-XfN91VNYtWjXq.md b/src/data/roadmaps/leetcode/content/daily-temperatures@pMCIlFk-XfN91VNYtWjXq.md new file mode 100644 index 000000000000..a6176e15034a --- /dev/null +++ b/src/data/roadmaps/leetcode/content/daily-temperatures@pMCIlFk-XfN91VNYtWjXq.md @@ -0,0 +1,3 @@ +# Daily Temperatures + +Given an array of daily temperatures, return an array where each element is the number of days until a warmer temperature. A monotonic stack stores indices of temperatures in decreasing order, and whenever a warmer day is found, all colder days in the stack get their answer. This problem is the entry point for the monotonic stack pattern, which appears in many harder problems. Visit the question on the LeetCode [website](https://leetcode.com/problems/daily-temperatures/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/design-add-and-search-words@xRqfE6liWrkLOVqqkXtjy.md b/src/data/roadmaps/leetcode/content/design-add-and-search-words@xRqfE6liWrkLOVqqkXtjy.md new file mode 100644 index 000000000000..33164bb8aa3c --- /dev/null +++ b/src/data/roadmaps/leetcode/content/design-add-and-search-words@xRqfE6liWrkLOVqqkXtjy.md @@ -0,0 +1,3 @@ +# Design Add and Search Words Data Structure + +Build a data structure that supports adding words and searching for words where a dot can match any letter. Exact characters navigate the trie normally, while a dot triggers DFS across all child nodes. This problem teaches you how to combine trie traversal with backtracking for wildcard matching. Visit the question on the LeetCode [website](https://leetcode.com/problems/design-add-and-search-words-data-structure/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/edit-distance@xemUw3R72U4hvgHSOcaMg.md b/src/data/roadmaps/leetcode/content/edit-distance@xemUw3R72U4hvgHSOcaMg.md new file mode 100644 index 000000000000..ddd1240cf1c7 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/edit-distance@xemUw3R72U4hvgHSOcaMg.md @@ -0,0 +1,3 @@ +# Edit Distance + +Given two strings, find the minimum number of insertions, deletions, or replacements to transform one into the other. A 2D DP table tracks the cost to convert each prefix of one string to each prefix of the other. This problem teaches you the three-way choice at each cell (insert, delete, replace) and is a foundational example of DP on two sequences. Visit the question on the LeetCode [website](https://leetcode.com/problems/edit-distance/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/find-median-from-data-stream@CJ8Hk6XfXuLHmBO6xdUv6.md b/src/data/roadmaps/leetcode/content/find-median-from-data-stream@CJ8Hk6XfXuLHmBO6xdUv6.md new file mode 100644 index 000000000000..1d64e486e4c3 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/find-median-from-data-stream@CJ8Hk6XfXuLHmBO6xdUv6.md @@ -0,0 +1,3 @@ +# Find Median from Data Stream + +Design a data structure that supports adding numbers one by one and returning the median at any point. You maintain two heaps: a max-heap for the lower half and a min-heap for the upper half, keeping them balanced so the median is always accessible at the top. This is the defining two-heap problem and teaches you how splitting a dataset into two heaps gives O(log n) insertion and O(1) median retrieval. Visit the question on the LeetCode [website](https://leetcode.com/problems/find-median-from-data-stream/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/gas-station@UWJLu3cfCGo487MOeu63T.md b/src/data/roadmaps/leetcode/content/gas-station@UWJLu3cfCGo487MOeu63T.md new file mode 100644 index 000000000000..ae302bc9f110 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/gas-station@UWJLu3cfCGo487MOeu63T.md @@ -0,0 +1,3 @@ +# Gas Station + +Given gas amounts and costs at each station on a circular route, find the starting station from which you can complete the circuit. If total gas is at least total cost, a solution exists, and the starting point is always after the last segment where the running tank went negative. This problem teaches you that a global observation (total gas vs total cost) can determine existence, while a local scan finds the answer. Visit the question on the LeetCode [website](https://leetcode.com/problems/gas-station/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/generate-parentheses@-dW4-xzasJY2CrwS2PyhN.md b/src/data/roadmaps/leetcode/content/generate-parentheses@-dW4-xzasJY2CrwS2PyhN.md new file mode 100644 index 000000000000..d2db7839da19 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/generate-parentheses@-dW4-xzasJY2CrwS2PyhN.md @@ -0,0 +1,3 @@ +# Generate Parentheses + +Given n, generate all combinations of well-formed parentheses. You build strings recursively, adding an opening bracket if you still have some left and a closing bracket only if it would not break validity. This problem sits at the boundary of stack and backtracking thinking, and teaches you to use constraints to prune a search space before exploring it. Visit the question on the LeetCode [website](https://leetcode.com/problems/generate-parentheses/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/go@OkdM_PJge70j5tsjT2Esl.md b/src/data/roadmaps/leetcode/content/go@OkdM_PJge70j5tsjT2Esl.md new file mode 100644 index 000000000000..4c771642abf8 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/go@OkdM_PJge70j5tsjT2Esl.md @@ -0,0 +1,3 @@ +# Go + +Go is a statically typed, compiled language designed for simplicity and performance. It is increasingly popular in backend and infrastructure roles and is commonly used at companies like Uber, Cloudflare, and Docker. Its syntax is minimal and its concurrency model is distinctive, but for LeetCode purposes what matters is its straightforward standard library and fast execution. Go does not have a built-in generic data structure library as rich as Java or C++, so you will sometimes need to implement things like heaps from scratch using the container/heap interface. It is a good choice if Go is your day-to-day language. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/graphs@ssT7KZITndEvfyqmjeclx.md b/src/data/roadmaps/leetcode/content/graphs@ssT7KZITndEvfyqmjeclx.md new file mode 100644 index 000000000000..05bbaee4f379 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/graphs@ssT7KZITndEvfyqmjeclx.md @@ -0,0 +1,3 @@ +# Stage 11 — Graphs + +Graphs generalize trees by allowing arbitrary connections and cycles. The two core traversal techniques, DFS and BFS, work on graphs the same way they do on trees, but you must now track visited nodes explicitly to avoid infinite loops. This stage covers the main graph problem types: counting connected components, detecting cycles, finding shortest paths in unweighted graphs, and topological ordering of dependencies. Grids are also implicit graphs, where each cell is a node and adjacency is defined by its four neighbors. Most graph problems reduce to one of these patterns once you recognize the structure. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/greedy@MU6i1n0KKiAU_FkBTB3hW.md b/src/data/roadmaps/leetcode/content/greedy@MU6i1n0KKiAU_FkBTB3hW.md new file mode 100644 index 000000000000..44617e906e35 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/greedy@MU6i1n0KKiAU_FkBTB3hW.md @@ -0,0 +1,3 @@ +# Stage 15 — Greedy + +Greedy algorithms make the locally optimal choice at each step and never revisit decisions. They are faster and simpler than DP when they work, but proving that a greedy choice leads to a globally optimal solution is not always obvious. The problems in this stage cover the most common greedy patterns: interval scheduling, jump games, and character frequency problems. A useful habit is to first ask whether a greedy approach is correct before coding it: can a short-sighted choice ever lead you away from the best solution? If the answer is yes, you probably need DP instead. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/group-anagrams@p7_B-NIBlqyKzR2PkrVWC.md b/src/data/roadmaps/leetcode/content/group-anagrams@p7_B-NIBlqyKzR2PkrVWC.md new file mode 100644 index 000000000000..19c4d52ca070 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/group-anagrams@p7_B-NIBlqyKzR2PkrVWC.md @@ -0,0 +1,3 @@ +# Group Anagrams + +Given a list of strings, group together all strings that are anagrams of each other. Since anagrams share the same characters, sorting each string gives a common key you can use in a hash map. A more optimal approach uses character frequency arrays as keys instead of sorting. This problem teaches you to think about what makes two things equivalent and use that equivalence as a grouping key, a useful mental model for many hash map problems. Visit the question on the LeetCode [website](https://leetcode.com/problems/group-anagrams/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/happy-number@VVB6zLZG6IxB4LQg8jIYT.md b/src/data/roadmaps/leetcode/content/happy-number@VVB6zLZG6IxB4LQg8jIYT.md new file mode 100644 index 000000000000..f69270a3900b --- /dev/null +++ b/src/data/roadmaps/leetcode/content/happy-number@VVB6zLZG6IxB4LQg8jIYT.md @@ -0,0 +1,3 @@ +# Happy Number + +A happy number is one that eventually reaches 1 when you repeatedly replace it with the sum of the squares of its digits. Detect whether a number is happy. This is a cycle detection problem: if the process loops without reaching 1, the number is not happy. You can use Floyd's algorithm or a set to detect the cycle. This problem teaches you to recognize cycle detection in non-graph contexts. Visit the question on the LeetCode [website](https://leetcode.com/problems/happy-number/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/heap--priority-queue@mvcSC0kFiD0AT5a2ffU5l.md b/src/data/roadmaps/leetcode/content/heap--priority-queue@mvcSC0kFiD0AT5a2ffU5l.md new file mode 100644 index 000000000000..d30a7e79c018 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/heap--priority-queue@mvcSC0kFiD0AT5a2ffU5l.md @@ -0,0 +1,3 @@ +# Stage 8 — Heap and Priority Queue + +A heap is the right data structure when you repeatedly need the largest or smallest element from a changing collection. The problems in this stage cover three heap patterns: top-k elements (maintain a heap of size k), two heaps (split a dataset into two halves to track the median), and k-way merge (combine multiple sorted sequences using a single heap). If you find yourself wanting to sort something repeatedly as new elements arrive, a heap is almost always the better choice. Getting comfortable with heap operations and knowing which variant to reach for is the main skill this stage develops. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/house-robber@GeLGoM3ocxZ-gjMUes4sE.md b/src/data/roadmaps/leetcode/content/house-robber@GeLGoM3ocxZ-gjMUes4sE.md new file mode 100644 index 000000000000..171d4df5e598 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/house-robber@GeLGoM3ocxZ-gjMUes4sE.md @@ -0,0 +1,3 @@ +# House Robber + +You are a robber planning to steal from houses in a row. You cannot rob two adjacent houses. Find the maximum amount you can steal. At each house you choose to rob it and skip the previous, or skip it and keep the best from before. This problem teaches the classic DP choice between taking the current element and combining it with a past state, or skipping it. Visit the question on the LeetCode [website](https://leetcode.com/problems/house-robber/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/implement-trie@_zumaNoKiaD4zS3wntAsd.md b/src/data/roadmaps/leetcode/content/implement-trie@_zumaNoKiaD4zS3wntAsd.md new file mode 100644 index 000000000000..25833de1b988 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/implement-trie@_zumaNoKiaD4zS3wntAsd.md @@ -0,0 +1,3 @@ +# Implement Trie + +Build a trie data structure that supports inserting a word, searching for an exact word, and checking if any word starts with a given prefix. Each node stores a map of child characters and a flag marking word endings. This problem teaches you the trie structure itself, which is prerequisite knowledge for all harder trie problems. Visit the question on the LeetCode [website](https://leetcode.com/problems/implement-trie-prefix-tree/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/insert-interval@BhiAYH1ug08LnPH8DtR1D.md b/src/data/roadmaps/leetcode/content/insert-interval@BhiAYH1ug08LnPH8DtR1D.md new file mode 100644 index 000000000000..9a67faeb4077 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/insert-interval@BhiAYH1ug08LnPH8DtR1D.md @@ -0,0 +1,3 @@ +# Insert Interval + +Given a sorted list of non-overlapping intervals and a new interval, insert it and merge any overlaps. You add all intervals that end before the new one starts, merge all that overlap with it, then add the rest. This problem teaches you to handle three distinct regions when inserting into a sorted interval list, a pattern that requires careful boundary thinking. Visit the question on the LeetCode [website](https://leetcode.com/problems/insert-interval/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/intervals@zHDAHN1gN5Ofx2eyQg5_7.md b/src/data/roadmaps/leetcode/content/intervals@zHDAHN1gN5Ofx2eyQg5_7.md new file mode 100644 index 000000000000..f7bace42c84c --- /dev/null +++ b/src/data/roadmaps/leetcode/content/intervals@zHDAHN1gN5Ofx2eyQg5_7.md @@ -0,0 +1,3 @@ +# Stage 16 — Intervals + +Interval problems appear frequently in scheduling, calendar, and range-based questions. The dominant technique is sorting by start or end time, which turns an otherwise quadratic overlap-checking problem into a linear scan. Once sorted, you can merge overlaps, count simultaneous events, or find gaps with a single pass. The harder problems in this stage combine interval sorting with a heap to answer queries efficiently. The key mindset shift is thinking of intervals as objects with a start and end, and reasoning about what it means for two intervals to overlap, contain, or be adjacent. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/java@gjZZOwmYkXQHPfg9Ynz80.md b/src/data/roadmaps/leetcode/content/java@gjZZOwmYkXQHPfg9Ynz80.md new file mode 100644 index 000000000000..8d9a40929404 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/java@gjZZOwmYkXQHPfg9Ynz80.md @@ -0,0 +1,3 @@ +# Java + +Java is one of the most commonly used interview languages, especially at large companies with backend and enterprise codebases. Its type system is verbose but explicit, and the standard library is comprehensive with well-documented data structures including priority queues, linked lists, and tree maps. Java forces you to think about types and interfaces clearly, which can actually help structure your thinking on harder problems. The main downside for interview prep is boilerplate: simple operations require more lines than in Python or Ruby. If Java is your primary language, it is a strong and widely accepted choice. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/javascript@HVD9G3JlLBsAg111vQILj.md b/src/data/roadmaps/leetcode/content/javascript@HVD9G3JlLBsAg111vQILj.md new file mode 100644 index 000000000000..ada2b259063f --- /dev/null +++ b/src/data/roadmaps/leetcode/content/javascript@HVD9G3JlLBsAg111vQILj.md @@ -0,0 +1,3 @@ +# JavaScript + +JavaScript is a solid choice if you already use it professionally or are preparing for frontend-focused roles. Its array methods and object literals are expressive, and most algorithmic patterns translate naturally to it. The main limitation is that JavaScript lacks a built-in heap or priority queue, so you will need to implement one or use a library when heap problems arise. If you are comfortable with JavaScript and do not want to switch languages just for interviews, it is a perfectly valid choice. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/jump-game-ii@gJ1O1H12KoNejTV_q0dsf.md b/src/data/roadmaps/leetcode/content/jump-game-ii@gJ1O1H12KoNejTV_q0dsf.md new file mode 100644 index 000000000000..4521324986a0 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/jump-game-ii@gJ1O1H12KoNejTV_q0dsf.md @@ -0,0 +1,3 @@ +# Jump Game II + +Given the same setup, find the minimum number of jumps to reach the last index. You greedily track the end of the current jump range and the furthest you can reach within it, incrementing the jump count when you exhaust the current range. This problem teaches you the two-range greedy technique, where you separate the current jump's boundary from the next one. Visit the question on the LeetCode [website](https://leetcode.com/problems/jump-game-ii/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/jump-game@so5popgQyB5vNRz_NYxo6.md b/src/data/roadmaps/leetcode/content/jump-game@so5popgQyB5vNRz_NYxo6.md new file mode 100644 index 000000000000..5ad7bad44689 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/jump-game@so5popgQyB5vNRz_NYxo6.md @@ -0,0 +1,3 @@ +# Jump Game + +Given an array where each element is the maximum jump length from that position, determine if you can reach the last index. You track the furthest position reachable so far and update it at each step. This problem teaches you the core greedy insight: you never need to track which specific jumps you take, only how far you can reach. Visit the question on the LeetCode [website](https://leetcode.com/problems/jump-game/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/k-closest-points-to-origin@iou03PtccY58DXKHARz_P.md b/src/data/roadmaps/leetcode/content/k-closest-points-to-origin@iou03PtccY58DXKHARz_P.md new file mode 100644 index 000000000000..8461aee75d25 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/k-closest-points-to-origin@iou03PtccY58DXKHARz_P.md @@ -0,0 +1,3 @@ +# K Closest Points to Origin + +Given a list of points, return the k closest to the origin. A max-heap of size k keeps the k smallest distances seen so far, ejecting any point farther than the current kth closest as you iterate. This problem shows how to adapt the top-k pattern to a custom comparison and is good practice for heap problems with custom keys. Visit the question on the LeetCode [website](https://leetcode.com/problems/k-closest-points-to-origin/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/koko-eating-bananas@wyU9wyyQ54KgMeRsbS9AM.md b/src/data/roadmaps/leetcode/content/koko-eating-bananas@wyU9wyyQ54KgMeRsbS9AM.md new file mode 100644 index 000000000000..710dd303b3bb --- /dev/null +++ b/src/data/roadmaps/leetcode/content/koko-eating-bananas@wyU9wyyQ54KgMeRsbS9AM.md @@ -0,0 +1,3 @@ +# Koko Eating Bananas + +Koko can eat at most k bananas per hour and must finish all piles within h hours. Find the minimum k. The answer lies in a range, and you can binary search on that range, checking for each candidate k whether it is feasible. This problem teaches you to binary search on the answer rather than on the input array, a shift in thinking that unlocks many harder problems. Visit the question on the LeetCode [website](https://leetcode.com/problems/koko-eating-bananas/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/kth-largest-element-in-an-array@tMvbBpZDawi2RjSFgOaWc.md b/src/data/roadmaps/leetcode/content/kth-largest-element-in-an-array@tMvbBpZDawi2RjSFgOaWc.md new file mode 100644 index 000000000000..b20459b7baa7 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/kth-largest-element-in-an-array@tMvbBpZDawi2RjSFgOaWc.md @@ -0,0 +1,3 @@ +# Kth Largest Element in an Array + +Given an unsorted array and an integer k, return the kth largest element. You can use a min-heap of size k: iterate through the array, push each element, and pop when the heap exceeds k. The top of the heap is then the kth largest. This problem teaches the core heap pattern: maintain a fixed-size heap to track top-k elements without sorting the entire array. Visit the question on the LeetCode [website](https://leetcode.com/problems/kth-largest-element-in-an-array/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/largest-rectangle-in-hist@zLM5eW7hZ7TrUzyNpvMyG.md b/src/data/roadmaps/leetcode/content/largest-rectangle-in-hist@zLM5eW7hZ7TrUzyNpvMyG.md new file mode 100644 index 000000000000..6bab75ed470a --- /dev/null +++ b/src/data/roadmaps/leetcode/content/largest-rectangle-in-hist@zLM5eW7hZ7TrUzyNpvMyG.md @@ -0,0 +1,3 @@ +# Largest Rectangle in Histogram + +Given an array of bar heights, find the area of the largest rectangle that fits in the histogram. A monotonic stack tracks bars in increasing order of height, and each time a shorter bar is encountered, rectangles extending from the previous bars are resolved. This is one of the hardest stack problems and teaches you to use a stack to resolve pending computations when a condition breaks. Visit the question on the LeetCode [website](https://leetcode.com/problems/largest-rectangle-in-histogram/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/linked-list-cycle@qAWeeYfvFD8-LTZgZ2LVa.md b/src/data/roadmaps/leetcode/content/linked-list-cycle@qAWeeYfvFD8-LTZgZ2LVa.md new file mode 100644 index 000000000000..32e6962148ce --- /dev/null +++ b/src/data/roadmaps/leetcode/content/linked-list-cycle@qAWeeYfvFD8-LTZgZ2LVa.md @@ -0,0 +1,3 @@ +# Linked List Cycle + +Given the head of a linked list, determine if it contains a cycle. The fast and slow pointer technique has one pointer move one step at a time and another move two, and if there is a cycle they will eventually meet. This problem introduces the fast and slow pointer pattern, which is used in several harder linked list problems. Visit the question on the LeetCode [website](https://leetcode.com/problems/linked-list-cycle/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/linked-list@lDT9PtNMP8lSdeH7EVBoH.md b/src/data/roadmaps/leetcode/content/linked-list@lDT9PtNMP8lSdeH7EVBoH.md new file mode 100644 index 000000000000..90ea41eb8b8b --- /dev/null +++ b/src/data/roadmaps/leetcode/content/linked-list@lDT9PtNMP8lSdeH7EVBoH.md @@ -0,0 +1,3 @@ +# Stage 6 — Linked List + +Linked list problems test your ability to manipulate pointers directly, without the convenience of index-based access. The core techniques are the dummy node (to simplify edge cases at the head), the fast and slow pointer (to find midpoints and detect cycles), and in-place reversal (to rearrange nodes without extra memory). These three techniques cover the majority of linked list problems. The problems here also build the pointer intuition you will need when working with trees in the next stage. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/longest-common-prefix@8HrT_SZWMlscj13G0gIID.md b/src/data/roadmaps/leetcode/content/longest-common-prefix@8HrT_SZWMlscj13G0gIID.md new file mode 100644 index 000000000000..196cd61b1743 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/longest-common-prefix@8HrT_SZWMlscj13G0gIID.md @@ -0,0 +1,3 @@ +# Longest Common Prefix + +Given an array of strings, find the longest common prefix among all of them. One approach inserts all strings into a trie and traverses down as long as each node has exactly one child and is not a word end. This problem is simpler than the others but teaches you that tries are not only for search, they also encode shared structure between strings. Visit the question on the LeetCode [website](https://leetcode.com/problems/longest-common-prefix/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/longest-common-subsequence@iodbhwYOWDM5JTaaqG4-m.md b/src/data/roadmaps/leetcode/content/longest-common-subsequence@iodbhwYOWDM5JTaaqG4-m.md new file mode 100644 index 000000000000..187005965731 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/longest-common-subsequence@iodbhwYOWDM5JTaaqG4-m.md @@ -0,0 +1,3 @@ +# Longest Common Subsequence + +Given two strings, find the length of their longest common subsequence. If characters match, you extend the LCS from the diagonal; otherwise you take the best from dropping one character in either string. This is the canonical 2D DP problem and teaches you how a 2D table captures the relationship between two sequences simultaneously. Visit the question on the LeetCode [website](https://leetcode.com/problems/longest-common-subsequence/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/longest-increasing-subsequ@h9yvrxDYEZ9mCqbeKoPEu.md b/src/data/roadmaps/leetcode/content/longest-increasing-subsequ@h9yvrxDYEZ9mCqbeKoPEu.md new file mode 100644 index 000000000000..16cf051023ee --- /dev/null +++ b/src/data/roadmaps/leetcode/content/longest-increasing-subsequ@h9yvrxDYEZ9mCqbeKoPEu.md @@ -0,0 +1,3 @@ +# Longest Increasing Subsequence + +Given an array, find the length of the longest strictly increasing subsequence. For each element, you check all previous elements that are smaller and extend the best subsequence ending there. This problem teaches you patience sorting and the classic O(n²) DP formulation, with an O(n log n) binary search optimization as a natural follow-up. Visit the question on the LeetCode [website](https://leetcode.com/problems/longest-increasing-subsequence/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/lowest-common-ancestor@cHPRRjBTrznI6UBC-WQP6.md b/src/data/roadmaps/leetcode/content/lowest-common-ancestor@cHPRRjBTrznI6UBC-WQP6.md new file mode 100644 index 000000000000..a02e94e451ff --- /dev/null +++ b/src/data/roadmaps/leetcode/content/lowest-common-ancestor@cHPRRjBTrznI6UBC-WQP6.md @@ -0,0 +1,3 @@ +# Lowest Common Ancestor of a BST + +Given a BST and two nodes, find their lowest common ancestor. Because it is a BST, you can use the values to decide whether to go left, right, or stop: the ancestor is where the two nodes diverge. This problem teaches you to exploit BST ordering as a navigation tool, rather than doing a general tree search. Visit the question on the LeetCode [website](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/math--geometry@Rx59jh-ynzC5wRGja3jvg.md b/src/data/roadmaps/leetcode/content/math--geometry@Rx59jh-ynzC5wRGja3jvg.md new file mode 100644 index 000000000000..35df33ee08aa --- /dev/null +++ b/src/data/roadmaps/leetcode/content/math--geometry@Rx59jh-ynzC5wRGja3jvg.md @@ -0,0 +1,3 @@ +# Stage 18 — Math and Geometry + +Math and geometry problems test your ability to translate a visual or numerical pattern into clean algorithmic logic. Many of these problems have elegant solutions that depend on a single mathematical observation, such as the structure of matrix rotation or the periodicity of digit sums. Unlike the earlier stages, there is no dominant pattern here. Instead, you are developing the habit of looking for structure in a problem before reaching for a general algorithm. These problems are a good test of problem-solving maturity: can you find the insight, or do you default to brute force? \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/maximum-depth-of-binary-tree@3ny1naGanScRUAOv2IiYz.md b/src/data/roadmaps/leetcode/content/maximum-depth-of-binary-tree@3ny1naGanScRUAOv2IiYz.md new file mode 100644 index 000000000000..756acfff0573 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/maximum-depth-of-binary-tree@3ny1naGanScRUAOv2IiYz.md @@ -0,0 +1,3 @@ +# Maximum Depth of Binary Tree + +Given a binary tree, return its maximum depth, meaning the number of nodes along the longest root-to-leaf path. You recursively compute the depth of left and right subtrees and return one plus the greater. This is the simplest tree DFS problem and teaches you to think about trees recursively: a tree's depth is defined in terms of its subtrees' depths. Visit the question on the LeetCode [website](https://leetcode.com/problems/maximum-depth-of-binary-tree/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/median-of-two-arrays@kV9z7UQsYFMR6umo0fDM1.md b/src/data/roadmaps/leetcode/content/median-of-two-arrays@kV9z7UQsYFMR6umo0fDM1.md new file mode 100644 index 000000000000..2b3e2db3087f --- /dev/null +++ b/src/data/roadmaps/leetcode/content/median-of-two-arrays@kV9z7UQsYFMR6umo0fDM1.md @@ -0,0 +1,3 @@ +# Median of Two Sorted Arrays + +Given two sorted arrays, find the median of their combined elements in O(log(min(m, n))). You binary search on the smaller array to find a partition where all elements on the left side are smaller than all on the right. This is one of the hardest binary search problems and teaches you to think about partitioning rather than searching for a single value. Visit the question on the LeetCode [website](https://leetcode.com/problems/median-of-two-sorted-arrays/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/meeting-rooms@9evXTNz1IVOnqWCQ7L5BW.md b/src/data/roadmaps/leetcode/content/meeting-rooms@9evXTNz1IVOnqWCQ7L5BW.md new file mode 100644 index 000000000000..21ee9515da59 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/meeting-rooms@9evXTNz1IVOnqWCQ7L5BW.md @@ -0,0 +1,3 @@ +# Meeting Rooms + +Given a list of meeting time intervals, determine if a person can attend all of them. You sort by start time and check if any meeting starts before the previous one ends. This is the simplest interval problem and teaches you that sorted order plus a single-pass scan resolves most interval overlap questions instantly. Visit the question on the LeetCode [website](https://leetcode.com/problems/meeting-rooms/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/merge-intervals@JsjPXTe3Zp5E7vCWUMeSe.md b/src/data/roadmaps/leetcode/content/merge-intervals@JsjPXTe3Zp5E7vCWUMeSe.md new file mode 100644 index 000000000000..fe6ff185ff91 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/merge-intervals@JsjPXTe3Zp5E7vCWUMeSe.md @@ -0,0 +1,3 @@ +# Merge Intervals + +Given a list of intervals, merge all overlapping ones. You sort by start time and iterate, extending the current interval when the next one overlaps, or starting a new one when it does not. This is the foundational interval problem and teaches you that sorting by start time reduces the overlap check to a single comparison with the previous interval's end. Visit the question on the LeetCode [website](https://leetcode.com/problems/merge-intervals/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/merge-k-sorted-lists@EC2dVHYWqGnu_1HmBeAPT.md b/src/data/roadmaps/leetcode/content/merge-k-sorted-lists@EC2dVHYWqGnu_1HmBeAPT.md new file mode 100644 index 000000000000..998166f218dd --- /dev/null +++ b/src/data/roadmaps/leetcode/content/merge-k-sorted-lists@EC2dVHYWqGnu_1HmBeAPT.md @@ -0,0 +1,3 @@ +# Merge K Sorted Lists + +Given k sorted linked lists, merge them into one sorted list using a min-heap. You insert the head of each list into the heap, then repeatedly extract the minimum and push the next node from that list. This problem sits at the intersection of heaps and linked lists and is the canonical k-way merge example. Visit the question on the LeetCode [website](https://leetcode.com/problems/merge-k-sorted-lists/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/merge-k-sorted-lists@eHnN9thTtLPIUtz9Z28OL.md b/src/data/roadmaps/leetcode/content/merge-k-sorted-lists@eHnN9thTtLPIUtz9Z28OL.md new file mode 100644 index 000000000000..d2ecfc74cf60 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/merge-k-sorted-lists@eHnN9thTtLPIUtz9Z28OL.md @@ -0,0 +1,3 @@ +# Merge K Sorted Lists + +Given k sorted linked lists, merge them into one sorted list. The optimal approach uses a min-heap to always extract the smallest current node across all lists. This problem connects linked list manipulation with heap usage and is the defining example of the k-way merge pattern. Visit the question on the LeetCode [website](https://leetcode.com/problems/merge-k-sorted-lists/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/merge-two-sorted-lists@qEYz2Dj1hqLDBFWYX7XmE.md b/src/data/roadmaps/leetcode/content/merge-two-sorted-lists@qEYz2Dj1hqLDBFWYX7XmE.md new file mode 100644 index 000000000000..0cd16dc68da4 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/merge-two-sorted-lists@qEYz2Dj1hqLDBFWYX7XmE.md @@ -0,0 +1,3 @@ +# Merge Two Sorted Lists + +Given the heads of two sorted linked lists, merge them into one sorted list by splicing nodes together without creating new ones. You compare the heads of both lists at each step and attach the smaller node to your result. This problem teaches you the dummy node technique, which simplifies edge cases when building a new list from scratch. Visit the question on the LeetCode [website](https://leetcode.com/problems/merge-two-sorted-lists/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/min-cost-to-connect-all-points@5NxA27PJ7_pN40xzd7Slp.md b/src/data/roadmaps/leetcode/content/min-cost-to-connect-all-points@5NxA27PJ7_pN40xzd7Slp.md new file mode 100644 index 000000000000..6f07bcaeed9b --- /dev/null +++ b/src/data/roadmaps/leetcode/content/min-cost-to-connect-all-points@5NxA27PJ7_pN40xzd7Slp.md @@ -0,0 +1,3 @@ +# Min Cost to Connect All Points + +Given a list of points, find the minimum cost to connect all of them where cost is the Manhattan distance between two points. This is a minimum spanning tree problem solvable with Prim's algorithm using a min-heap, always picking the cheapest edge to an unvisited node. This problem teaches you that MST problems feel similar to Dijkstra but the goal is different: connect everything, not find shortest paths. Visit the question on the LeetCode [website](https://leetcode.com/problems/min-cost-to-connect-all-points/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/min-interval-to-include-query@eYPhWnyTPhfbXco_G4bN_.md b/src/data/roadmaps/leetcode/content/min-interval-to-include-query@eYPhWnyTPhfbXco_G4bN_.md new file mode 100644 index 000000000000..6256b2006126 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/min-interval-to-include-query@eYPhWnyTPhfbXco_G4bN_.md @@ -0,0 +1,3 @@ +# Minimum Interval to Include Each Query + +Given a list of intervals and queries, for each query find the length of the smallest interval that contains it. You sort both intervals and queries, use a min-heap keyed by interval length, and process queries in order. This is the hardest interval problem in this stage and teaches you the offline query technique, processing queries in sorted order alongside a heap. Visit the question on the LeetCode [website](https://leetcode.com/problems/minimum-interval-to-include-each-query/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/min-stack@XjJhO0gX0Dw8yF09TnJwK.md b/src/data/roadmaps/leetcode/content/min-stack@XjJhO0gX0Dw8yF09TnJwK.md new file mode 100644 index 000000000000..8e9add66793f --- /dev/null +++ b/src/data/roadmaps/leetcode/content/min-stack@XjJhO0gX0Dw8yF09TnJwK.md @@ -0,0 +1,3 @@ +# Min Stack + +Design a stack that supports push, pop, top, and retrieving the minimum element, all in O(1) time. The trick is to maintain a second stack that tracks the current minimum at each level. This problem teaches you that stacks can be augmented to carry extra state without breaking their core behavior. Visit the question on the LeetCode [website](https://leetcode.com/problems/min-stack/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/minimum-in-rotated-array@XYTIX8oNH3qCmXjRbycDi.md b/src/data/roadmaps/leetcode/content/minimum-in-rotated-array@XYTIX8oNH3qCmXjRbycDi.md new file mode 100644 index 000000000000..4c5d9e818ef6 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/minimum-in-rotated-array@XYTIX8oNH3qCmXjRbycDi.md @@ -0,0 +1,3 @@ +# Find Minimum in Rotated Sorted Array + +Given a rotated sorted array, find the minimum element in O(log n). The minimum is always at the rotation point, and you can locate it by checking which half is sorted and narrowing toward the unsorted side. This problem teaches you to think about what binary search is really doing: eliminating halves, not just finding a value. Visit the question on the LeetCode [website](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/minimum-window-substring@P7scdQHmNUPA6UI36yBtL.md b/src/data/roadmaps/leetcode/content/minimum-window-substring@P7scdQHmNUPA6UI36yBtL.md new file mode 100644 index 000000000000..021e6a547bbb --- /dev/null +++ b/src/data/roadmaps/leetcode/content/minimum-window-substring@P7scdQHmNUPA6UI36yBtL.md @@ -0,0 +1,3 @@ +# Minimum Window Substring + +Given strings s and t, find the smallest substring of s that contains all characters of t. You expand the right pointer until you have a valid window, then shrink from the left as much as possible while keeping it valid. This is one of the hardest sliding window problems and teaches you to manage a character frequency map as the window changes. Visit the question on the LeetCode [website](https://leetcode.com/problems/minimum-window-substring/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@0u8IQZvJV7ORHcBfUBQ7R.md b/src/data/roadmaps/leetcode/content/more-excersises@0u8IQZvJV7ORHcBfUBQ7R.md new file mode 100644 index 000000000000..2703779e356e --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@0u8IQZvJV7ORHcBfUBQ7R.md @@ -0,0 +1,9 @@ +# More Exercises + +Below you can find other popular questions covering Math and Geometry. Work through these once you are comfortable with the five above. + +- [Multiply Strings](https://leetcode.com/problems/multiply-strings/) +- [Detect Squares](https://leetcode.com/problems/detect-squares/) +- [Plus One](https://leetcode.com/problems/plus-one/) +- [Count Primes](https://leetcode.com/problems/count-primes/) +- [Excel Sheet Column Number](https://leetcode.com/problems/excel-sheet-column-number/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@2r0q7Gic8orJx2w28OH_I.md b/src/data/roadmaps/leetcode/content/more-excersises@2r0q7Gic8orJx2w28OH_I.md new file mode 100644 index 000000000000..321a7766db92 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@2r0q7Gic8orJx2w28OH_I.md @@ -0,0 +1,9 @@ +# More Exercises + +Below you can find other popular questions covering Binary Search. Work through these once you are comfortable with the five above. + +- [Search a 2D Matrix](https://leetcode.com/problems/search-a-2d-matrix/) +- [Time Based Key-Value Store](https://leetcode.com/problems/time-based-key-value-store/) +- [Capacity to Ship Packages Within D Days](https://leetcode.com/problems/capacity-to-ship-packages-within-d-days/) +- [Find First and Last Position of Element in Sorted Array](https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/) +- [Find Peak Element](https://leetcode.com/problems/find-peak-element/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@2vhZHAKoFeNoi1utHcPPw.md b/src/data/roadmaps/leetcode/content/more-excersises@2vhZHAKoFeNoi1utHcPPw.md new file mode 100644 index 000000000000..ad881505d243 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@2vhZHAKoFeNoi1utHcPPw.md @@ -0,0 +1,9 @@ +# More Exercises + +Below you can find other popular questions covering Heap and Priority Queue. Work through these once you are comfortable with the five above. + +- [Kth Largest Element in a Stream](https://leetcode.com/problems/kth-largest-element-in-a-stream/) +- [Last Stone Weight](https://leetcode.com/problems/last-stone-weight/) +- [Design Twitter](https://leetcode.com/problems/design-twitter/) +- [Reorganize String](https://leetcode.com/problems/reorganize-string/) +- [Sliding Window Median](https://leetcode.com/problems/sliding-window-median/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@AMT2zQPDlKUm-d2vT1Sae.md b/src/data/roadmaps/leetcode/content/more-excersises@AMT2zQPDlKUm-d2vT1Sae.md new file mode 100644 index 000000000000..f4075ffe5261 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@AMT2zQPDlKUm-d2vT1Sae.md @@ -0,0 +1,9 @@ +# More Exercises + +Below you can find other popular questions covering Sliding Window. Work through these once you are comfortable with the five above. + +- [Permutation in String](https://leetcode.com/problems/permutation-in-string/) +- [Fruits into Baskets](https://leetcode.com/problems/fruit-into-baskets/) +- [Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/) +- [Subarray Product Less Than K](https://leetcode.com/problems/subarray-product-less-than-k/) +- [Max Consecutive Ones III](https://leetcode.com/problems/max-consecutive-ones-iii/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@EBqzxy-2FWK4FwHyNKVHP.md b/src/data/roadmaps/leetcode/content/more-excersises@EBqzxy-2FWK4FwHyNKVHP.md new file mode 100644 index 000000000000..5c79f633b945 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@EBqzxy-2FWK4FwHyNKVHP.md @@ -0,0 +1,9 @@ +# More Exercises + +Below you can find other popular questions covering 1-D Dynamic Programming. Work through these once you are comfortable with the five above. + +- [House Robber II](https://leetcode.com/problems/house-robber-ii/) +- [Decode Ways](https://leetcode.com/problems/decode-ways/) +- [Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/) +- [Partition Equal Subset Sum](https://leetcode.com/problems/partition-equal-subset-sum/) +- [Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@G1SqIZkN9dBKsv2LxqP8D.md b/src/data/roadmaps/leetcode/content/more-excersises@G1SqIZkN9dBKsv2LxqP8D.md new file mode 100644 index 000000000000..ce7d6d18884d --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@G1SqIZkN9dBKsv2LxqP8D.md @@ -0,0 +1,9 @@ +# More Exercises + +Below you can find other popular questions covering Backtracking. Work through these once you are comfortable with the five above. + +- [Subsets II](https://leetcode.com/problems/subsets-ii/) +- [Combination Sum II](https://leetcode.com/problems/combination-sum-ii/) +- [Palindrome Partitioning](https://leetcode.com/problems/palindrome-partitioning/) +- [Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) +- [Sudoku Solver](https://leetcode.com/problems/sudoku-solver/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@JtV6pQzvcXFoNG01tx9pq.md b/src/data/roadmaps/leetcode/content/more-excersises@JtV6pQzvcXFoNG01tx9pq.md new file mode 100644 index 000000000000..cfeeefe698dd --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@JtV6pQzvcXFoNG01tx9pq.md @@ -0,0 +1,9 @@ +# More Excersises + +Below you can find other popular questions covering Arrays & Hashing. Work through these once you are comfortable with the five above. + +- [Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/) +- [Valid Sudoku](https://leetcode.com/problems/valid-sudoku/) +- [Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/) +- [Encode and Decode Strings](https://leetcode.com/problems/encode-and-decode-strings/) +- [Majority Element](https://leetcode.com/problems/majority-element/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@KHLCYCZqfXqVlHAs7YVHv.md b/src/data/roadmaps/leetcode/content/more-excersises@KHLCYCZqfXqVlHAs7YVHv.md new file mode 100644 index 000000000000..cd11d2b14db4 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@KHLCYCZqfXqVlHAs7YVHv.md @@ -0,0 +1,9 @@ +# More Exercises + +Below you can find other popular questions covering Greedy. Work through these once you are comfortable with the five above. + +- [Hand of Straights](https://leetcode.com/problems/hand-of-straights/) +- [Merge Triplets to Form Target Triplet](https://leetcode.com/problems/merge-triplets-to-form-a-target-triplet/) +- [Valid Parenthesis String](https://leetcode.com/problems/valid-parenthesis-string/) +- [Candy](https://leetcode.com/problems/candy/) +- [IPO](https://leetcode.com/problems/ipo/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@NFOzXHoSHj1_2_isVifsY.md b/src/data/roadmaps/leetcode/content/more-excersises@NFOzXHoSHj1_2_isVifsY.md new file mode 100644 index 000000000000..024419e30f06 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@NFOzXHoSHj1_2_isVifsY.md @@ -0,0 +1,9 @@ +# More Exercises + +Below you can find other popular questions covering Two Pointers. Work through these once you are comfortable with the five above. + +- [Sort Colors](https://leetcode.com/problems/sort-colors/) +- [Move Zeroes](https://leetcode.com/problems/move-zeroes/) +- [Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) +- [Boats to Save People](https://leetcode.com/problems/boats-to-save-people/) +- [4Sum](https://leetcode.com/problems/4sum/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@Q-vNw7YUh-4U6im7nrHe8.md b/src/data/roadmaps/leetcode/content/more-excersises@Q-vNw7YUh-4U6im7nrHe8.md new file mode 100644 index 000000000000..ed4354970742 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@Q-vNw7YUh-4U6im7nrHe8.md @@ -0,0 +1,9 @@ +# More Exercises + +Below you can find other popular questions covering Intervals. Work through these once you are comfortable with the five above. + +- [Meeting Rooms II](https://leetcode.com/problems/meeting-rooms-ii/) +- [Employee Free Time](https://leetcode.com/problems/employee-free-time/) +- [Car Pooling](https://leetcode.com/problems/car-pooling/) +- [Interval List Intersections](https://leetcode.com/problems/interval-list-intersections/) +- [My Calendar I](https://leetcode.com/problems/my-calendar-i/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@Q0AxfKbRuyY5rY2pO5xcP.md b/src/data/roadmaps/leetcode/content/more-excersises@Q0AxfKbRuyY5rY2pO5xcP.md new file mode 100644 index 000000000000..4800855ec5e7 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@Q0AxfKbRuyY5rY2pO5xcP.md @@ -0,0 +1,9 @@ +# More Exercises + +Below you can find other popular questions covering Graphs. Work through these once you are comfortable with the five above. + +- [Max Area of Island](https://leetcode.com/problems/max-area-of-island/) +- [Rotting Oranges](https://leetcode.com/problems/rotting-oranges/) +- [Course Schedule II](https://leetcode.com/problems/course-schedule-ii/) +- [Redundant Connection](https://leetcode.com/problems/redundant-connection/) +- [Number of Connected Components in an Undirected Graph](https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@Ur6eSm0t-jQD2j710Vc89.md b/src/data/roadmaps/leetcode/content/more-excersises@Ur6eSm0t-jQD2j710Vc89.md new file mode 100644 index 000000000000..e3bc787834f3 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@Ur6eSm0t-jQD2j710Vc89.md @@ -0,0 +1,9 @@ +# More Exercises + +Below you can find other popular questions covering Linked List. Work through these once you are comfortable with the five above. + +- [Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) +- [Copy List With Random Pointer](https://leetcode.com/problems/copy-list-with-random-pointer/) +- [Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) +- [LRU Cache](https://leetcode.com/problems/lru-cache/) +- [Reverse Nodes in K-Group](https://leetcode.com/problems/reverse-nodes-in-k-group/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@VpquOgXr8OG_jLkeDSk3H.md b/src/data/roadmaps/leetcode/content/more-excersises@VpquOgXr8OG_jLkeDSk3H.md new file mode 100644 index 000000000000..9f4587baf6d7 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@VpquOgXr8OG_jLkeDSk3H.md @@ -0,0 +1,9 @@ +# More Exercises + +Below you can find other popular questions covering Stack. Work through these once you are comfortable with the five above. + +- [Evaluate Reverse Polish Notation](https://leetcode.com/problems/evaluate-reverse-polish-notation/) +- [Car Fleet](https://leetcode.com/problems/car-fleet/) +- [Asteroid Collision](https://leetcode.com/problems/asteroid-collision/) +- [Remove K Digits](https://leetcode.com/problems/remove-k-digits/) +- [Next Greater Element I](https://leetcode.com/problems/next-greater-element-i/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@XjViEOLzyd_BK9dhgNtdK.md b/src/data/roadmaps/leetcode/content/more-excersises@XjViEOLzyd_BK9dhgNtdK.md new file mode 100644 index 000000000000..28ccc2b5c970 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@XjViEOLzyd_BK9dhgNtdK.md @@ -0,0 +1,9 @@ +# More Exercises + +Below you can find other popular questions covering Trees. Work through these once you are comfortable with the five above. + +- [Invert Binary Tree](https://leetcode.com/problems/invert-binary-tree/) +- [Diameter of Binary Tree](https://leetcode.com/problems/diameter-of-binary-tree/) +- [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) +- [Binary Tree Right Side View](https://leetcode.com/problems/binary-tree-right-side-view/) +- [Construct Binary Tree from Preorder and Inorder Traversal](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@awYK5VUD2HS9ywJQfFYU7.md b/src/data/roadmaps/leetcode/content/more-excersises@awYK5VUD2HS9ywJQfFYU7.md new file mode 100644 index 000000000000..05595e3f01d4 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@awYK5VUD2HS9ywJQfFYU7.md @@ -0,0 +1,9 @@ +# More Exercises + +Below you can find other popular questions covering Bit Manipulation. Work through these once you are comfortable with the five above. + +- [Missing Number](https://leetcode.com/problems/missing-number/) +- [Reverse Integer](https://leetcode.com/problems/reverse-integer/) +- [Power of Two](https://leetcode.com/problems/power-of-two/) +- [Bitwise AND of Numbers Range](https://leetcode.com/problems/bitwise-and-of-numbers-range/) +- [Single Number II](https://leetcode.com/problems/single-number-ii/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@i4A57jKrkhlw-jW3i3HSi.md b/src/data/roadmaps/leetcode/content/more-excersises@i4A57jKrkhlw-jW3i3HSi.md new file mode 100644 index 000000000000..7690a3627f0e --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@i4A57jKrkhlw-jW3i3HSi.md @@ -0,0 +1,9 @@ +# More Exercises + +Below you can find other popular questions covering Advanced Graphs. Work through these once you are comfortable with the five above. + +- [Alien Dictionary](https://leetcode.com/problems/alien-dictionary/) +- [Path with Maximum Probability](https://leetcode.com/problems/path-with-maximum-probability/) +- [Find the City With the Smallest Number of Neighbors at a Threshold Distance](https://leetcode.com/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/) +- [Minimum Spanning Tree](https://leetcode.com/problems/connecting-cities-with-minimum-cost/) +- [Shortest Path in Binary Matrix](https://leetcode.com/problems/shortest-path-in-binary-matrix/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@licG83FALxf4jPOV7v_an.md b/src/data/roadmaps/leetcode/content/more-excersises@licG83FALxf4jPOV7v_an.md new file mode 100644 index 000000000000..8921ad238633 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@licG83FALxf4jPOV7v_an.md @@ -0,0 +1,9 @@ +# More Exercises + +Below you can find other popular questions covering 2-D Dynamic Programming. Work through these once you are comfortable with the five above. + +- [Best Time to Buy and Sell Stock with Cooldown](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/) +- [Coin Change II](https://leetcode.com/problems/coin-change-ii/) +- [Target Sum](https://leetcode.com/problems/target-sum/) +- [Interleaving String](https://leetcode.com/problems/interleaving-string/) +- [Distinct Subsequences](https://leetcode.com/problems/distinct-subsequences/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/more-excersises@y-quVGz8J5Rmz2ixUFwBI.md b/src/data/roadmaps/leetcode/content/more-excersises@y-quVGz8J5Rmz2ixUFwBI.md new file mode 100644 index 000000000000..4e0cbebded8f --- /dev/null +++ b/src/data/roadmaps/leetcode/content/more-excersises@y-quVGz8J5Rmz2ixUFwBI.md @@ -0,0 +1,9 @@ +# More Exercises + +Below you can find other popular questions covering Tries. Work through these once you are comfortable with the five above. + +- [Extra Characters in a String](https://leetcode.com/problems/extra-characters-in-a-string/) +- [Sum of Prefix Scores of Strings](https://leetcode.com/problems/sum-of-prefix-scores-of-strings/) +- [Palindrome Pairs](https://leetcode.com/problems/palindrome-pairs/) +- [Index Pairs of a String](https://leetcode.com/problems/index-pairs-of-a-string/) +- [Search Suggestions System](https://leetcode.com/problems/search-suggestions-system/) \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/n-queens@fBtsnKP5n3WBjMycwIfir.md b/src/data/roadmaps/leetcode/content/n-queens@fBtsnKP5n3WBjMycwIfir.md new file mode 100644 index 000000000000..603bf2ff20f2 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/n-queens@fBtsnKP5n3WBjMycwIfir.md @@ -0,0 +1,3 @@ +# N-Queens + +Place n queens on an n by n chessboard so that no two queens attack each other, and return all valid configurations. You place queens row by row and use sets to track which columns and diagonals are occupied, backtracking when a row has no valid placement. This is the classic constraint satisfaction problem and teaches you to use auxiliary state to prune the search space aggressively. Visit the question on the LeetCode [website](https://leetcode.com/problems/n-queens/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/network-delay-time@zSqCHDbPvWsDRtEURoVNK.md b/src/data/roadmaps/leetcode/content/network-delay-time@zSqCHDbPvWsDRtEURoVNK.md new file mode 100644 index 000000000000..face2bb8bce6 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/network-delay-time@zSqCHDbPvWsDRtEURoVNK.md @@ -0,0 +1,3 @@ +# Network Delay Time + +Given a network of nodes and weighted directed edges, find the time it takes for a signal to reach all nodes from a source. This is Dijkstra's algorithm: you use a min-heap to always process the closest unvisited node next. This problem teaches you Dijkstra's algorithm in its clearest form, without extra complications, making it the best starting point for weighted shortest path problems. Visit the question on the LeetCode [website](https://leetcode.com/problems/network-delay-time/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/non-overlapping-intervals@Mc1jQ5_-trqgCckM23cjQ.md b/src/data/roadmaps/leetcode/content/non-overlapping-intervals@Mc1jQ5_-trqgCckM23cjQ.md new file mode 100644 index 000000000000..9256a98ec9fb --- /dev/null +++ b/src/data/roadmaps/leetcode/content/non-overlapping-intervals@Mc1jQ5_-trqgCckM23cjQ.md @@ -0,0 +1,3 @@ +# Non-overlapping Intervals + +Given a list of intervals, find the minimum number of intervals to remove so that the rest do not overlap. You sort by end time and greedily keep every interval that does not conflict with the last kept one. This problem teaches the classic interval scheduling insight: always prefer the interval that ends earliest, since it leaves the most room for future intervals. Visit the question on the LeetCode [website](https://leetcode.com/problems/non-overlapping-intervals/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/non-overlapping-intervals@k0XOp6P-EIyRKrSbsgr0w.md b/src/data/roadmaps/leetcode/content/non-overlapping-intervals@k0XOp6P-EIyRKrSbsgr0w.md new file mode 100644 index 000000000000..bcadfa7b98bd --- /dev/null +++ b/src/data/roadmaps/leetcode/content/non-overlapping-intervals@k0XOp6P-EIyRKrSbsgr0w.md @@ -0,0 +1,3 @@ +# Non-overlapping Intervals + +Given a list of intervals, find the minimum number to remove so that no two intervals overlap. Sorting by end time and greedily keeping non-conflicting intervals gives the maximum number you can keep, and the answer is total minus that. This problem reinforces the greedy interval scheduling principle and connects directly to the activity selection problem in algorithm theory. Visit the question on the LeetCode [website](https://leetcode.com/problems/non-overlapping-intervals/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/number-of-1-bits@XzQHEP8HYq_vYFWLon4rI.md b/src/data/roadmaps/leetcode/content/number-of-1-bits@XzQHEP8HYq_vYFWLon4rI.md new file mode 100644 index 000000000000..6f6398d47fed --- /dev/null +++ b/src/data/roadmaps/leetcode/content/number-of-1-bits@XzQHEP8HYq_vYFWLon4rI.md @@ -0,0 +1,3 @@ +# Number of 1 Bits + +Given a 32-bit integer, count how many bits are set to 1. You can check the last bit with a bitwise AND and shift right repeatedly, or use the trick n & (n-1) which clears the lowest set bit, counting until n becomes zero. This problem teaches you to inspect and clear individual bits, a fundamental bit manipulation skill. Visit the question on the LeetCode [website](https://leetcode.com/problems/number-of-1-bits/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/number-of-islands@LInRfygQmBDTFbezzM97o.md b/src/data/roadmaps/leetcode/content/number-of-islands@LInRfygQmBDTFbezzM97o.md new file mode 100644 index 000000000000..afd2ab94936f --- /dev/null +++ b/src/data/roadmaps/leetcode/content/number-of-islands@LInRfygQmBDTFbezzM97o.md @@ -0,0 +1,3 @@ +# Number of Islands + +Given a 2D grid of land and water cells, count the number of islands. You do DFS from each unvisited land cell, marking the entire connected landmass as visited before moving on. This is the entry point for graph DFS on a matrix and teaches you to treat a grid as an implicit graph where adjacency is defined by up, down, left, right neighbors. Visit the question on the LeetCode [website](https://leetcode.com/problems/number-of-islands/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/pacific-atlantic-water-flow@mhSb4eQV970bLlOfFg84p.md b/src/data/roadmaps/leetcode/content/pacific-atlantic-water-flow@mhSb4eQV970bLlOfFg84p.md new file mode 100644 index 000000000000..da77bd09f50f --- /dev/null +++ b/src/data/roadmaps/leetcode/content/pacific-atlantic-water-flow@mhSb4eQV970bLlOfFg84p.md @@ -0,0 +1,3 @@ +# Pacific Atlantic Water Flow + +Given a matrix of heights, find all cells from which water can flow to both the Pacific and Atlantic oceans. You reverse the problem: do BFS inward from each ocean's border, marking all reachable cells, then return cells reachable from both. This problem teaches you that reversing the direction of traversal can turn an exponential problem into a linear one. Visit the question on the LeetCode [website](https://leetcode.com/problems/pacific-atlantic-water-flow/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/partition-labels@V7pvMzno_woUHHSfLTv7q.md b/src/data/roadmaps/leetcode/content/partition-labels@V7pvMzno_woUHHSfLTv7q.md new file mode 100644 index 000000000000..fd29dbaf870e --- /dev/null +++ b/src/data/roadmaps/leetcode/content/partition-labels@V7pvMzno_woUHHSfLTv7q.md @@ -0,0 +1,3 @@ +# Partition Labels + +Given a string, partition it into as many parts as possible so that each letter appears in at most one part. You find the last occurrence of each character first, then greedily extend the current partition's boundary as you scan. This problem teaches you how to greedily build non-overlapping intervals using the last-occurrence anchor, a pattern that appears in several interval problems. Visit the question on the LeetCode [website](https://leetcode.com/problems/partition-labels/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/permutations@-9-5g5Qyb3JiSwEfabmRD.md b/src/data/roadmaps/leetcode/content/permutations@-9-5g5Qyb3JiSwEfabmRD.md new file mode 100644 index 000000000000..cf0dca6a58f8 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/permutations@-9-5g5Qyb3JiSwEfabmRD.md @@ -0,0 +1,3 @@ +# Permutations + +Given an array of distinct integers, return all possible orderings. Unlike subsets, order matters here, so at each step you pick any unused element and continue recursively. This problem teaches you the difference between combination-style and permutation-style backtracking, and how to track which elements have been used. Visit the question on the LeetCode [website](https://leetcode.com/problems/permutations/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/pick-a-language@SKsKYHmpPBjG9tHHFbTLI.md b/src/data/roadmaps/leetcode/content/pick-a-language@SKsKYHmpPBjG9tHHFbTLI.md new file mode 100644 index 000000000000..3e00e084844c --- /dev/null +++ b/src/data/roadmaps/leetcode/content/pick-a-language@SKsKYHmpPBjG9tHHFbTLI.md @@ -0,0 +1,3 @@ +# Pick a language + +For LeetCode and technical interviews, the language you use matters less than how well you know it. Pick one language and stick with it throughout your preparation. Switching between languages wastes time and splits your focus. What interviewers care about is whether you can write clean, correct code and explain your reasoning clearly. That said, some languages have practical advantages: Python is concise and fast to write, which is helpful under time pressure. Java and C++ are common in companies that care about performance. JavaScript is a natural choice if you are coming from frontend development. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/powx-n@ea7dib41v61Vz--ewLcF4.md b/src/data/roadmaps/leetcode/content/powx-n@ea7dib41v61Vz--ewLcF4.md new file mode 100644 index 000000000000..d568bffa8ef6 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/powx-n@ea7dib41v61Vz--ewLcF4.md @@ -0,0 +1,3 @@ +# Pow(x, n) + +Implement the power function that raises x to the nth power, including negative exponents, in O(log n). You use fast exponentiation: square the base and halve the exponent at each step, handling odd exponents by multiplying in an extra factor. This problem teaches you recursive divide-and-conquer on a numerical computation, and is the standard way to implement exponentiation efficiently. Visit the question on the LeetCode [website](https://leetcode.com/problems/powx-n/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/python@BZvNEZjCNuHPg5SkX90bt.md b/src/data/roadmaps/leetcode/content/python@BZvNEZjCNuHPg5SkX90bt.md new file mode 100644 index 000000000000..124cc86d0cdb --- /dev/null +++ b/src/data/roadmaps/leetcode/content/python@BZvNEZjCNuHPg5SkX90bt.md @@ -0,0 +1,3 @@ +# Python + +Python is the most popular language for LeetCode preparation and for good reason. Its syntax is concise, its built-in data structures like lists, dictionaries, and sets map directly to the structures you use in almost every problem, and the standard library includes a heap module and collections utilities that save significant time. Writing a sliding window or a DFS in Python requires far fewer lines than in most other languages. If you do not have a strong preference, Python is the recommended default for this roadmap. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/reconstruct-itinerary@Edk5ydpwut57XDc08QEgc.md b/src/data/roadmaps/leetcode/content/reconstruct-itinerary@Edk5ydpwut57XDc08QEgc.md new file mode 100644 index 000000000000..f1547d840900 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/reconstruct-itinerary@Edk5ydpwut57XDc08QEgc.md @@ -0,0 +1,3 @@ +# Reconstruct Itinerary + +Given a list of airline tickets, reconstruct the itinerary in lexical order starting from JFK, using all tickets exactly once. You use DFS with a sorted adjacency list and add nodes to the result only after all their outgoing edges are exhausted, which is Hierholzer's algorithm for Eulerian paths. This problem teaches you a non-obvious graph traversal where the order of adding nodes to the result is reversed. Visit the question on the LeetCode [website](https://leetcode.com/problems/reconstruct-itinerary/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/regular-expression-matching@XTDdSFywX863IErL0rmc6.md b/src/data/roadmaps/leetcode/content/regular-expression-matching@XTDdSFywX863IErL0rmc6.md new file mode 100644 index 000000000000..57ce0c4123a8 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/regular-expression-matching@XTDdSFywX863IErL0rmc6.md @@ -0,0 +1,3 @@ +# Regular Expression Matching + +Given a string and a pattern with dot and star wildcards, determine if the pattern matches the entire string. A 2D DP table tracks whether each prefix of the string matches each prefix of the pattern, with special handling for the star operator. This is one of the hardest 2D DP problems and teaches you to handle optional repetition in DP, where a character can appear zero or more times. Visit the question on the LeetCode [website](https://leetcode.com/problems/regular-expression-matching/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/reorder-list@FYgKuhnZ20g6-v4UrQDJc.md b/src/data/roadmaps/leetcode/content/reorder-list@FYgKuhnZ20g6-v4UrQDJc.md new file mode 100644 index 000000000000..5e2ad4a0d1c1 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/reorder-list@FYgKuhnZ20g6-v4UrQDJc.md @@ -0,0 +1,3 @@ +# Reorder List + +Given a linked list, reorder it so that nodes alternate from the front and back of the original list. You find the middle, reverse the second half, then merge the two halves together. This problem combines three sub-techniques (finding middle, reversing, merging) and teaches you to decompose complex pointer problems into simpler steps. Visit the question on the LeetCode [website](https://leetcode.com/problems/reorder-list/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/replace-words@IINhLJ2evjsS_v2DH3AA1.md b/src/data/roadmaps/leetcode/content/replace-words@IINhLJ2evjsS_v2DH3AA1.md new file mode 100644 index 000000000000..a8a22d8ae423 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/replace-words@IINhLJ2evjsS_v2DH3AA1.md @@ -0,0 +1,3 @@ +# Replace Words + +Given a dictionary of root words and a sentence, replace each word in the sentence with its shortest matching root from the dictionary. You insert all roots into a trie, then for each word in the sentence traverse the trie character by character until you hit a root or fail. This problem teaches you practical trie lookup with early termination, which is the core of trie efficiency. Visit the question on the LeetCode [website](https://leetcode.com/problems/replace-words/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/reverse-bits@KHR39YdCVeSGJtHrcLJyT.md b/src/data/roadmaps/leetcode/content/reverse-bits@KHR39YdCVeSGJtHrcLJyT.md new file mode 100644 index 000000000000..458dcc1ed914 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/reverse-bits@KHR39YdCVeSGJtHrcLJyT.md @@ -0,0 +1,3 @@ +# Reverse Bits + +Given a 32-bit unsigned integer, reverse its bits. You build the result bit by bit by extracting the last bit from the input and shifting it into the result. This problem teaches you how to construct a new number bit by bit using shifts and masks, which is useful in many low-level and embedded contexts. Visit the question on the LeetCode [website](https://leetcode.com/problems/reverse-bits/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/reverse-linked-list@0P0VTUhQxWj0BGygtuKYJ.md b/src/data/roadmaps/leetcode/content/reverse-linked-list@0P0VTUhQxWj0BGygtuKYJ.md new file mode 100644 index 000000000000..e23417d973f1 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/reverse-linked-list@0P0VTUhQxWj0BGygtuKYJ.md @@ -0,0 +1,3 @@ +# Reverse Linked List + +Given the head of a linked list, reverse it in place and return the new head. You iterate through the list keeping track of the previous node, current node, and next node, rewiring each pointer as you go. This is the first linked list problem most people learn and it teaches you the three-pointer technique that underlies almost every in-place list manipulation. Visit the question on the LeetCode [website](https://leetcode.com/problems/reverse-linked-list/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/rotate-image@P9U_DFbutAYwQGZjjf-oP.md b/src/data/roadmaps/leetcode/content/rotate-image@P9U_DFbutAYwQGZjjf-oP.md new file mode 100644 index 000000000000..ff38446b7dd0 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/rotate-image@P9U_DFbutAYwQGZjjf-oP.md @@ -0,0 +1,3 @@ +# Rotate Image + +Given an n by n matrix, rotate it 90 degrees clockwise in place. You first transpose the matrix (swap across the diagonal), then reverse each row. This problem teaches you that complex in-place transformations often decompose into two simpler operations applied in sequence. Visit the question on the LeetCode [website](https://leetcode.com/problems/rotate-image/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/ruby@XyRCXhZjQFcDNaUSNNQV-.md b/src/data/roadmaps/leetcode/content/ruby@XyRCXhZjQFcDNaUSNNQV-.md new file mode 100644 index 000000000000..101f2744f6bc --- /dev/null +++ b/src/data/roadmaps/leetcode/content/ruby@XyRCXhZjQFcDNaUSNNQV-.md @@ -0,0 +1,3 @@ +# Ruby + +Ruby is an expressive, readable language with clean syntax and strong built-in enumerable methods that make array and hash manipulation concise. It is less common in technical interviews than Python, JavaScript, or Java, but it is a valid choice if you use it professionally and are comfortable with it. One practical consideration is that Ruby solutions on LeetCode are sometimes slower than equivalent solutions in compiled languages, which can occasionally cause timeout issues on harder problems. Use Ruby if it is your strongest language, but be aware of this limitation. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/rust@9h1mz0xAUvPrnRm9VndJF.md b/src/data/roadmaps/leetcode/content/rust@9h1mz0xAUvPrnRm9VndJF.md new file mode 100644 index 000000000000..a98c337d3dfe --- /dev/null +++ b/src/data/roadmaps/leetcode/content/rust@9h1mz0xAUvPrnRm9VndJF.md @@ -0,0 +1,3 @@ +# Rust + +Rust is a systems programming language focused on memory safety and performance without a garbage collector. It is gaining popularity for roles in systems programming, WebAssembly, and performance-critical applications. For LeetCode, Rust is the most challenging language to use due to its strict ownership model, which can make pointer-heavy problems like linked lists and trees significantly more complex to implement than in other languages. If you are already comfortable with Rust and want to use it for interviews, it is possible and impressive, but it is not recommended as a starting point for interview preparation. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/scala@acgRMEuL4ZGGRHpZ7kXSo.md b/src/data/roadmaps/leetcode/content/scala@acgRMEuL4ZGGRHpZ7kXSo.md new file mode 100644 index 000000000000..88bb4aef6f2f --- /dev/null +++ b/src/data/roadmaps/leetcode/content/scala@acgRMEuL4ZGGRHpZ7kXSo.md @@ -0,0 +1,3 @@ +# Scala + +Scala is a functional and object-oriented language that runs on the JVM and is popular in data engineering and distributed systems roles. Its expressive type system and functional abstractions like pattern matching and higher-order functions can make some algorithmic problems elegant to solve. However, Scala is rarely the expected language in general software engineering interviews, and LeetCode support for it is more limited. Choose Scala only if you are specifically targeting roles where it is the primary language and you are already fluent in it. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/search-in-rotated-array@aDKtHMczSpCIT-ST0irRa.md b/src/data/roadmaps/leetcode/content/search-in-rotated-array@aDKtHMczSpCIT-ST0irRa.md new file mode 100644 index 000000000000..1135b73e42c8 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/search-in-rotated-array@aDKtHMczSpCIT-ST0irRa.md @@ -0,0 +1,3 @@ +# Search in Rotated Sorted Array + +A sorted array has been rotated at an unknown index. Find a target value in O(log n). At every step, one of the two halves must be sorted, and you can use that to decide which half to search. This problem teaches you to apply binary search even when the input is not perfectly sorted, by adding a condition to identify the sorted half. Visit the question on the LeetCode [website](https://leetcode.com/problems/search-in-rotated-sorted-array/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/serialize-and-deserialize@DH3ZU-8q765Kjm7SIu_qP.md b/src/data/roadmaps/leetcode/content/serialize-and-deserialize@DH3ZU-8q765Kjm7SIu_qP.md new file mode 100644 index 000000000000..2ed85fa9a6d0 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/serialize-and-deserialize@DH3ZU-8q765Kjm7SIu_qP.md @@ -0,0 +1,3 @@ +# Serialize and Deserialize Binary Tree + +Design an algorithm to convert a binary tree to a string and reconstruct it exactly from that string. One approach uses BFS level-order, encoding null pointers explicitly so the structure can be recovered. This problem teaches you that tree traversal is not just for reading trees but also for encoding and rebuilding them, a fundamental idea in tree design problems. Visit the question on the LeetCode [website](https://leetcode.com/problems/serialize-and-deserialize-binary-tree/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/set-matrix-zeroes@ScROycnqOk2U2GW-Ghy2W.md b/src/data/roadmaps/leetcode/content/set-matrix-zeroes@ScROycnqOk2U2GW-Ghy2W.md new file mode 100644 index 000000000000..45accd6be899 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/set-matrix-zeroes@ScROycnqOk2U2GW-Ghy2W.md @@ -0,0 +1,3 @@ +# Set Matrix Zeroes + +Given a matrix, if any cell is zero, set its entire row and column to zero, in place. The trick is to record which rows and columns need zeroing before making any changes, using the first row and column as markers to avoid extra space. This problem teaches you to use existing space within the matrix to avoid allocating extra memory, a useful in-place technique. Visit the question on the LeetCode [website](https://leetcode.com/problems/set-matrix-zeroes/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/single-number@4UGevGjQBhbISeh_5bm_e.md b/src/data/roadmaps/leetcode/content/single-number@4UGevGjQBhbISeh_5bm_e.md new file mode 100644 index 000000000000..6cd18ba91f78 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/single-number@4UGevGjQBhbISeh_5bm_e.md @@ -0,0 +1,3 @@ +# Single Number + +Given an array where every element appears twice except one, find the element that appears only once. XOR of a number with itself is zero, and XOR of a number with zero is the number itself, so XOR-ing all elements cancels duplicates and leaves the unique one. This problem is the entry point to bit manipulation and teaches you that XOR is a surprisingly powerful tool for finding missing or unique values. Visit the question on the LeetCode [website](https://leetcode.com/problems/single-number/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/sliding-window-maximum@zIpM4hiGUSXwkokZFRzSB.md b/src/data/roadmaps/leetcode/content/sliding-window-maximum@zIpM4hiGUSXwkokZFRzSB.md new file mode 100644 index 000000000000..aa49762418be --- /dev/null +++ b/src/data/roadmaps/leetcode/content/sliding-window-maximum@zIpM4hiGUSXwkokZFRzSB.md @@ -0,0 +1,3 @@ +# Sliding Window Maximum + +Given an array and a window size k, return the maximum value in each window. A monotonic deque stores indices in decreasing order of value, so the front is always the current maximum. This problem teaches you the monotonic deque, which gives O(n) window max where a heap would give O(n log n). Visit the question on the LeetCode [website](https://leetcode.com/problems/sliding-window-maximum/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/sliding-window@1boDzMfojddbf1ZwzOvEV.md b/src/data/roadmaps/leetcode/content/sliding-window@1boDzMfojddbf1ZwzOvEV.md new file mode 100644 index 000000000000..fba3f5c88670 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/sliding-window@1boDzMfojddbf1ZwzOvEV.md @@ -0,0 +1,3 @@ +# Stage 5 — Sliding Window + +The sliding window pattern is used when you need to find an optimal subarray or substring that satisfies some constraint. Instead of checking every possible subarray from scratch, you maintain a window with two pointers and update the result incrementally as the window expands or shrinks. Fixed-size windows are straightforward; variable-size windows require a clear rule for when to shrink from the left. This stage also introduces the monotonic deque, which extends sliding window to problems that need the maximum or minimum within the window at each step. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/spiral-matrix@H6lLJWRhjRVq5ZqKEJ8bL.md b/src/data/roadmaps/leetcode/content/spiral-matrix@H6lLJWRhjRVq5ZqKEJ8bL.md new file mode 100644 index 000000000000..1c8277f877ee --- /dev/null +++ b/src/data/roadmaps/leetcode/content/spiral-matrix@H6lLJWRhjRVq5ZqKEJ8bL.md @@ -0,0 +1,3 @@ +# Spiral Matrix + +Given an m by n matrix, return all elements in spiral order. You maintain four boundaries (top, bottom, left, right) and peel one layer at a time, moving right, down, left, then up, shrinking the boundaries after each direction. This problem teaches careful boundary management and is a good test of whether you can translate a visual pattern into clean code. Visit the question on the LeetCode [website](https://leetcode.com/problems/spiral-matrix/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/stacks@Ovs61JkceGbWV3BfUo4Ra.md b/src/data/roadmaps/leetcode/content/stacks@Ovs61JkceGbWV3BfUo4Ra.md new file mode 100644 index 000000000000..52ff8674a1d8 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/stacks@Ovs61JkceGbWV3BfUo4Ra.md @@ -0,0 +1,3 @@ +# Stage 3 — Stack + +A stack is the right tool whenever you need to process elements in a last-in-first-out order, or when you need to track something that will be resolved later. Many stack problems involve matching pairs, maintaining a running minimum or maximum, or deferring a computation until a future element triggers it. The monotonic stack variant, where you maintain elements in increasing or decreasing order, is particularly important and appears frequently in harder problems involving histograms, temperatures, and next greater elements. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/subsets@2AfJtRru4gll77Vl-6IJM.md b/src/data/roadmaps/leetcode/content/subsets@2AfJtRru4gll77Vl-6IJM.md new file mode 100644 index 000000000000..bd4ef26cc18c --- /dev/null +++ b/src/data/roadmaps/leetcode/content/subsets@2AfJtRru4gll77Vl-6IJM.md @@ -0,0 +1,3 @@ +# Subsets + +Given an array of unique integers, return all possible subsets including the empty set. You use backtracking to make a binary decision at each element: include it or skip it, building subsets recursively. This problem teaches the foundation of backtracking, the include/exclude decision tree that underpins all subset and combination problems. Visit the question on the LeetCode [website](https://leetcode.com/problems/subsets/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/substring-without-repetition@wnHn7ooWZSUfk3HahuyG6.md b/src/data/roadmaps/leetcode/content/substring-without-repetition@wnHn7ooWZSUfk3HahuyG6.md new file mode 100644 index 000000000000..dfa51d4f98e2 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/substring-without-repetition@wnHn7ooWZSUfk3HahuyG6.md @@ -0,0 +1,3 @@ +# Longest Substring Without Repeating Characters + +Find the length of the longest substring that contains no duplicate characters. You expand the right pointer and shrink the left pointer whenever a duplicate enters the window, using a set to track current characters. This is the canonical variable-size sliding window problem and teaches you the expand-then-shrink rhythm that most substring problems follow. Visit the question on the LeetCode [website](https://leetcode.com/problems/longest-substring-without-repeating-characters/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/sum-of-two-integers@cUgRS-8TyPT98LemGFBf3.md b/src/data/roadmaps/leetcode/content/sum-of-two-integers@cUgRS-8TyPT98LemGFBf3.md new file mode 100644 index 000000000000..c477dd3b75f8 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/sum-of-two-integers@cUgRS-8TyPT98LemGFBf3.md @@ -0,0 +1,3 @@ +# Sum of Two Integers + +Calculate the sum of two integers without using the plus or minus operators. XOR gives the sum without carries, and AND shifted left gives the carries. You repeat until there are no more carries. This problem teaches you how addition works at the bit level and deepens your understanding of carry propagation. Visit the question on the LeetCode [website](https://leetcode.com/problems/sum-of-two-integers/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/swim-in-rising-water@0x9RwyrxbUZj30e-tMdWP.md b/src/data/roadmaps/leetcode/content/swim-in-rising-water@0x9RwyrxbUZj30e-tMdWP.md new file mode 100644 index 000000000000..7f36c5bcb8bf --- /dev/null +++ b/src/data/roadmaps/leetcode/content/swim-in-rising-water@0x9RwyrxbUZj30e-tMdWP.md @@ -0,0 +1,3 @@ +# Swim in Rising Water + +Given a grid where each cell has a height, find the earliest time t such that you can travel from top-left to bottom-right, moving only through cells with height at most t. You binary search on t or use Dijkstra treating each cell's height as the cost. This problem teaches you to reframe a graph problem as a min-max path problem, where you minimize the maximum cost along any path. Visit the question on the LeetCode [website](https://leetcode.com/problems/swim-in-rising-water/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/task-scheduler@HLTc2xupm-CNM9rgzrcwS.md b/src/data/roadmaps/leetcode/content/task-scheduler@HLTc2xupm-CNM9rgzrcwS.md new file mode 100644 index 000000000000..22e6aa7ba98e --- /dev/null +++ b/src/data/roadmaps/leetcode/content/task-scheduler@HLTc2xupm-CNM9rgzrcwS.md @@ -0,0 +1,3 @@ +# Task Scheduler + +Given a list of tasks and a cooldown n, find the minimum time needed to finish all tasks, with the constraint that the same task must wait n intervals between executions. A greedy approach with a max-heap always schedules the most frequent remaining task, filling cooldown gaps with other tasks or idle time. This problem teaches you to combine a heap with a greedy scheduling strategy. Visit the question on the LeetCode [website](https://leetcode.com/problems/task-scheduler/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/top-k-frequent-elements@-RjNtskTl7CZYWUpQ6YPh.md b/src/data/roadmaps/leetcode/content/top-k-frequent-elements@-RjNtskTl7CZYWUpQ6YPh.md new file mode 100644 index 000000000000..146f76ff893e --- /dev/null +++ b/src/data/roadmaps/leetcode/content/top-k-frequent-elements@-RjNtskTl7CZYWUpQ6YPh.md @@ -0,0 +1,3 @@ +# Top K Frequent Elements + +Given an array and a number k, return the k most frequent elements. You could sort by frequency, but the optimal approach uses bucket sort. Since no element can appear more times than the length of the array, you can create buckets indexed by frequency and scan from the top. This problem bridges hash maps and sorting, and introduces the idea that the constraints of a problem often suggest a faster algorithm. Visit the question on the LeetCode [website](https://leetcode.com/problems/top-k-frequent-elements/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/trapping-rain-water@GuWseHiGMKbBqkYKrZNuT.md b/src/data/roadmaps/leetcode/content/trapping-rain-water@GuWseHiGMKbBqkYKrZNuT.md new file mode 100644 index 000000000000..f43036c20a7a --- /dev/null +++ b/src/data/roadmaps/leetcode/content/trapping-rain-water@GuWseHiGMKbBqkYKrZNuT.md @@ -0,0 +1,3 @@ +# Trapping Rain Water + +Given an array of bar heights representing an elevation map, compute how much water can be trapped between the bars after rain. For each position, the water level is determined by the shorter of the tallest bars to its left and right. Two pointers eliminate the need to precompute these maximums separately. This is one of the hardest two pointer problems and teaches you to reason about what constrains a value from both sides. Visit the question on the LeetCode [website](https://leetcode.com/problems/trapping-rain-water/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/trees@PQ31G4_7Y5K6D34hVRyRK.md b/src/data/roadmaps/leetcode/content/trees@PQ31G4_7Y5K6D34hVRyRK.md new file mode 100644 index 000000000000..35f050f17c54 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/trees@PQ31G4_7Y5K6D34hVRyRK.md @@ -0,0 +1,3 @@ +# Stage 7 — Trees + +Trees are the data structure where recursion becomes natural. Most tree problems follow one of two patterns: DFS, where you go deep before backtracking, and BFS, where you process nodes level by level. DFS is usually implemented recursively and is good for path-based and structural problems. BFS uses a queue and is good for level-based problems and shortest-path questions on unweighted trees. The key habit to build here is thinking clearly about what a function returns versus what it records as a side effect, since many tree problems require tracking a global answer while the recursion handles local decisions. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/tries@dmY-zE1Lql_HfTnhMfKMV.md b/src/data/roadmaps/leetcode/content/tries@dmY-zE1Lql_HfTnhMfKMV.md new file mode 100644 index 000000000000..03a0cb11f501 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/tries@dmY-zE1Lql_HfTnhMfKMV.md @@ -0,0 +1,3 @@ +# Stage 10 — Tries + +A trie is a tree structure built from the characters of strings, where each path from root to a marked node spells out a word. It is the right data structure when you need fast prefix lookups across a large set of strings. A hash map can check if a whole word exists, but a trie can check if any word in your dictionary starts with a given prefix in O(length) time. The three problems in this stage cover building a trie, searching with wildcards, and using a trie to prune a grid search, which together cover the full range of trie applications in interviews. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/two-pointers@NHv86YI2-MSH8BkfUsaEx.md b/src/data/roadmaps/leetcode/content/two-pointers@NHv86YI2-MSH8BkfUsaEx.md new file mode 100644 index 000000000000..a4b89c436f8d --- /dev/null +++ b/src/data/roadmaps/leetcode/content/two-pointers@NHv86YI2-MSH8BkfUsaEx.md @@ -0,0 +1,3 @@ +# Stage 2 — Two Pointers + +Two pointers is the first real pattern you will learn, and it is one of the most reusable. The idea is simple: instead of checking every pair of elements with nested loops, you place one pointer at each end of a sorted structure and move them toward each other based on a condition. This brings many O(n²) problems down to O(n). Most problems here require a sorted input, so sorting is often the first step. Mastering this pattern also prepares you for fast and slow pointers, which appear in linked list problems later. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/two-sum-ii@vTpv8AliKFv0Sf13PmVCo.md b/src/data/roadmaps/leetcode/content/two-sum-ii@vTpv8AliKFv0Sf13PmVCo.md new file mode 100644 index 000000000000..f685125a2c44 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/two-sum-ii@vTpv8AliKFv0Sf13PmVCo.md @@ -0,0 +1,3 @@ +# Two Sum II + +Given a sorted array, find two numbers that add up to a target and return their positions. Because the array is sorted, you can use two pointers starting from each end and move them based on whether the current sum is too large or too small. This is where the two pointer pattern clicks for most learners, since the sorted order gives a clear rule for which pointer to move. Visit the question on the LeetCode [website](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/two-sum@XbfUbWaGtpcEGa31QyrXN.md b/src/data/roadmaps/leetcode/content/two-sum@XbfUbWaGtpcEGa31QyrXN.md index c5bc6a6439ba..07a1c52a063e 100644 --- a/src/data/roadmaps/leetcode/content/two-sum@XbfUbWaGtpcEGa31QyrXN.md +++ b/src/data/roadmaps/leetcode/content/two-sum@XbfUbWaGtpcEGa31QyrXN.md @@ -1,7 +1,3 @@ # Two Sum -The Two Sum problem asks you to find two numbers within an array that, when added together, equal a specific target value. You are typically given an array of integers and a target integer. The goal is to return the indices of the two numbers that sum up to the target. It's often assumed that each input array will have exactly one solution, and you cannot use the same element twice. - -Visit the following resources to learn more: - -- [@official@Two Sum](https://leetcode.com/problems/two-sum/description/) \ No newline at end of file +You are given an array of integers and a target number. The goal is to find two numbers in the array that add up to the target and return their positions. The naive approach checks every pair, but the key insight is using a hash map to store numbers you have already seen, bringing the solution from O(n²) down to O(n). This problem teaches the core habit of trading space for time, a trade-off you will use constantly in harder problems. Visit the question on the LeetCode [website](https://leetcode.com/problems/two-sum/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/unique-paths@xhEBSwgHsrCQolM9UvJ-c.md b/src/data/roadmaps/leetcode/content/unique-paths@xhEBSwgHsrCQolM9UvJ-c.md new file mode 100644 index 000000000000..1987d78820b9 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/unique-paths@xhEBSwgHsrCQolM9UvJ-c.md @@ -0,0 +1,3 @@ +# Unique Paths + +A robot starts at the top-left of an m by n grid and can only move right or down. Find the number of unique paths to the bottom-right. Each cell's count is the sum of the cell above and the cell to the left. This is the simplest 2D DP problem and teaches you to think in terms of a grid where each cell builds on its neighbors. Visit the question on the LeetCode [website](https://leetcode.com/problems/unique-paths/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/valid-anagram@iqR33GoIxK-CJdbatQqg3.md b/src/data/roadmaps/leetcode/content/valid-anagram@iqR33GoIxK-CJdbatQqg3.md new file mode 100644 index 000000000000..770c3b0b8a39 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/valid-anagram@iqR33GoIxK-CJdbatQqg3.md @@ -0,0 +1,3 @@ +# Valid Anagram + +Given two strings, decide if one is an anagram of the other, meaning both contain the exact same characters with the same frequency. The trick is not to sort (which works but is slower), but to count character frequencies using a hash map and compare them. This problem teaches you to think about strings as frequency distributions rather than sequences of characters. Visit the question on the LeetCode [website](https://leetcode.com/problems/valid-anagram/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/valid-palindrome@x6-LRp_zgv3WNE-gsS3Cw.md b/src/data/roadmaps/leetcode/content/valid-palindrome@x6-LRp_zgv3WNE-gsS3Cw.md new file mode 100644 index 000000000000..d4d6ae304704 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/valid-palindrome@x6-LRp_zgv3WNE-gsS3Cw.md @@ -0,0 +1,3 @@ +# Valid Palindrome + +Given a string, determine if it reads the same forwards and backwards after removing non-alphanumeric characters and ignoring case. Two pointers start at each end and move inward, comparing characters as they go. This problem teaches you to use two pointers on a string and is a clean entry point for understanding how pointers can replace nested loops. Visit the question on the LeetCode [website](https://leetcode.com/problems/valid-palindrome/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/valid-parentheses@YNt85B--HBS2IKDFVLJpx.md b/src/data/roadmaps/leetcode/content/valid-parentheses@YNt85B--HBS2IKDFVLJpx.md new file mode 100644 index 000000000000..d75ee3c45afe --- /dev/null +++ b/src/data/roadmaps/leetcode/content/valid-parentheses@YNt85B--HBS2IKDFVLJpx.md @@ -0,0 +1,3 @@ +# Valid Parentheses + +Given a string of brackets, determine if it is valid, meaning every opening bracket is closed by the same type in the correct order. You push opening brackets onto a stack and pop when you see a closing bracket, checking for a match. This is the canonical stack problem and teaches you the key idea: a stack naturally tracks things that need a future match. Visit the question on the LeetCode [website](https://leetcode.com/problems/valid-parentheses/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/what-are-coding-patterns@ScTtg57POE0kxlZFxYUCs.md b/src/data/roadmaps/leetcode/content/what-are-coding-patterns@ScTtg57POE0kxlZFxYUCs.md new file mode 100644 index 000000000000..5777b4753bf4 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/what-are-coding-patterns@ScTtg57POE0kxlZFxYUCs.md @@ -0,0 +1,3 @@ +# What are coding patterns? + +Coding patterns are recurring problem-solving strategies that apply across many different problems. Instead of memorizing solutions, you learn to recognize the structure of a problem and match it to a pattern you already know. Once you internalize around fifteen to twenty patterns, you can approach most interview problems with a starting point rather than a blank page. This roadmap is organized around those patterns. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/what-is-leetcode@DUZWC157r-xhcJZ__p8wQ.md b/src/data/roadmaps/leetcode/content/what-is-leetcode@DUZWC157r-xhcJZ__p8wQ.md new file mode 100644 index 000000000000..dc7609fd0617 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/what-is-leetcode@DUZWC157r-xhcJZ__p8wQ.md @@ -0,0 +1,3 @@ +# What is LeetCode + +LeetCode is an online platform with hundreds of coding problems used by software engineers to prepare for technical interviews. Companies like Google, Meta, Amazon, and Microsoft use similar problems in their hiring process to evaluate how candidates think through algorithmic challenges. You do not need to solve thousands of problems to be ready. What matters is understanding the patterns behind problems well enough to apply them to ones you have never seen before. LeetCode is the practice ground, not the goal. \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/word-break@1i59D4ME10oOkxthILaNP.md b/src/data/roadmaps/leetcode/content/word-break@1i59D4ME10oOkxthILaNP.md new file mode 100644 index 000000000000..ca75e35d0dd4 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/word-break@1i59D4ME10oOkxthILaNP.md @@ -0,0 +1,3 @@ +# Word Break + +Given a string and a dictionary of words, determine if the string can be segmented into a sequence of dictionary words. You use DP where each position stores whether the substring up to that point can be formed, checking every possible last word. This problem teaches you how to use a boolean DP array to track reachability, a pattern that appears in many string segmentation problems. Visit the question on the LeetCode [website](https://leetcode.com/problems/word-break/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/word-ladder@J8YZFOS2sVwILJWdUphIU.md b/src/data/roadmaps/leetcode/content/word-ladder@J8YZFOS2sVwILJWdUphIU.md new file mode 100644 index 000000000000..78a1f402a171 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/word-ladder@J8YZFOS2sVwILJWdUphIU.md @@ -0,0 +1,3 @@ +# Word Ladder + +Given a start word and an end word, find the shortest transformation sequence where each step changes exactly one letter and every intermediate word must exist in a given word list. BFS gives the shortest path, and each word's neighbors are found by replacing each character with every letter. This is the hardest graph problem in this stage and teaches you to model an abstract problem as a shortest-path graph problem. Visit the question on the LeetCode [website](https://leetcode.com/problems/word-ladder/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/word-search-ii@46Y-wvaUJZwd32mRqrRix.md b/src/data/roadmaps/leetcode/content/word-search-ii@46Y-wvaUJZwd32mRqrRix.md new file mode 100644 index 000000000000..3a8585be4862 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/word-search-ii@46Y-wvaUJZwd32mRqrRix.md @@ -0,0 +1,3 @@ +# Word Search II + +Given a board of characters and a list of words, return all words that exist in the board. You build a trie from the word list and do DFS from each cell, pruning paths that do not match any trie prefix. This problem is the hardest trie problem in this stage and teaches you how a trie dramatically reduces the search space compared to checking each word separately. Visit the question on the LeetCode [website](https://leetcode.com/problems/word-search-ii/). \ No newline at end of file diff --git a/src/data/roadmaps/leetcode/content/word-search@boJmdiyIgbV61MDKsB-k-.md b/src/data/roadmaps/leetcode/content/word-search@boJmdiyIgbV61MDKsB-k-.md new file mode 100644 index 000000000000..cdfef4567172 --- /dev/null +++ b/src/data/roadmaps/leetcode/content/word-search@boJmdiyIgbV61MDKsB-k-.md @@ -0,0 +1,3 @@ +# Word Search + +Given a 2D grid of characters and a word, determine if the word exists in the grid by following adjacent cells. You do DFS from each cell that matches the first character, marking visited cells to avoid reuse in the current path. This problem teaches you backtracking on a 2D grid, where you must undo your visited marks when a path fails. Visit the question on the LeetCode [website](https://leetcode.com/problems/word-search/). \ No newline at end of file