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 index 5f6090db9b5f..b62e931efa1f 100644 --- a/src/data/roadmaps/leetcode/content/1-d-dynamic-programming@sRU06JyWqwCnRDYEAV53L.md +++ b/src/data/roadmaps/leetcode/content/1-d-dynamic-programming@sRU06JyWqwCnRDYEAV53L.md @@ -1,3 +1,8 @@ -# Stage 13 — 1-D Dynamic Programming +# 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 +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. + +Visit the following resources to learn more: + +- [@article@1-D Dynamic Programming Problem](https://www.scaler.com/topics/data-structures/1-d-dynamic-programming-problem/) +- [@video@5 Simple Steps for Solving Dynamic Programming Problems](https://www.youtube.com/watch?v=aPQY__2H3tE) \ 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 index 33614cd1a95e..3af4968003e9 100644 --- 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 @@ -1,3 +1,8 @@ -# Stage 14 — 2-D Dynamic Programming +# 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 +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. + +Visit the following resources to learn more: + +- [@video@Learn Dynamic Programming with Animations – Full Course for Beginners](https://www.youtube.com/watch?v=66hDgWottdA) +- [@video@Dynamic Programming 2D - Full Course - Python](https://www.youtube.com/watch?v=qMky6D6YtXU) \ 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 index 330a4d04fde6..c5a34d86f02b 100644 --- a/src/data/roadmaps/leetcode/content/3sum@yis4-_D0GREukouiRcCwC.md +++ b/src/data/roadmaps/leetcode/content/3sum@yis4-_D0GREukouiRcCwC.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@3Sum - LeetCode](https://leetcode.com/problems/3sum/description/) +- [@video@3Sum (Updated Solution)](https://www.youtube.com/watch?v=TBePcj8DgxM) +- [@video@3 Sum (LeetCode 15)](https://www.youtube.com/watch?v=cRBSOz49fQk&t=39s) \ 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 index 9e061774917f..433781701921 100644 --- a/src/data/roadmaps/leetcode/content/advanced-graphs@jNYQFvR3IafFXbAQHL4bF.md +++ b/src/data/roadmaps/leetcode/content/advanced-graphs@jNYQFvR3IafFXbAQHL4bF.md @@ -1,3 +1,3 @@ -# Stage 12 — Advanced Graphs +# 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 index 79749d1b9df4..58e009c21d34 100644 --- a/src/data/roadmaps/leetcode/content/arrays--hashing@C4M0XfOtB9_Q8srAJU__A.md +++ b/src/data/roadmaps/leetcode/content/arrays--hashing@C4M0XfOtB9_Q8srAJU__A.md @@ -1,3 +1,10 @@ -# Stage 1 — Arrays & Hashing +# 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 +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. + +Visit the following resources to learn more: + +- [@article@DSA Arrays](https://www.w3schools.com/dsa/dsa_data_arrays.php) +- [@article@DSA Hash Tables](https://www.w3schools.com/dsa/dsa_theory_hashtables.php) +- [@article@Learning Data Structures](https://medium.com/@ashissh.dev/learning-data-structures-arrays-and-hash-tables-6ced329a9189) +- [@video@Ep.1 - Arrays & Hashing](https://www.youtube.com/watch?v=nET1jqI_Ntk) \ 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 index b957c127f161..d0dc628baad1 100644 --- a/src/data/roadmaps/leetcode/content/backtracking@gEZFGJPq0JFjpRwl3z3XK.md +++ b/src/data/roadmaps/leetcode/content/backtracking@gEZFGJPq0JFjpRwl3z3XK.md @@ -1,3 +1,9 @@ -# Stage 9 — Backtracking +# 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 +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. + +Visit the following resources to learn more: + +- [@article@Backtracking Overview](https://www.hellointerview.com/learn/code/backtracking/overview) +- [@video@Backtracking Algorithm in 120 Seconds](https://www.youtube.com/watch?v=RtpJOGvfo7E) +- [@video@Introduction to Backtracking - Brute Force Approach](https://www.youtube.com/watch?v=DKCbsiDBN6c) \ 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 index e0d130c27a2a..58f6a7b76c75 100644 --- 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 @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) +- [@video@LeetCode Best Time to Buy and Sell Stock Solution](https://www.youtube.com/watch?v=3RHCb8LY-X4) +- [@video@Best Time to Buy and Sell Stock](https://www.youtube.com/watch?v=kJZrMGpyWpk) \ 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 index 44132ce8b008..b57966b27b97 100644 --- a/src/data/roadmaps/leetcode/content/binary-search@OkNQABVymkpxvHE7gVids.md +++ b/src/data/roadmaps/leetcode/content/binary-search@OkNQABVymkpxvHE7gVids.md @@ -1,3 +1,8 @@ -# Stage 4 — Binary Search +# 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 +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. + +Visit the following resources to learn more: + +- [@article@Binary Search](https://www.w3schools.com/dsa/dsa_algo_binarysearch.php) +- [@video@Binary Search Algorithm in 100 Seconds](https://www.youtube.com/watch?v=MFhxShGxHWc) \ 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 index 03c1b08deaf3..8afeb20b8490 100644 --- a/src/data/roadmaps/leetcode/content/binary-search@kxvOWb6wyF8GWarP6jrqK.md +++ b/src/data/roadmaps/leetcode/content/binary-search@kxvOWb6wyF8GWarP6jrqK.md @@ -1,3 +1,8 @@ # 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 +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 following resources to learn more: + +- [@article@Binary Search](https://leetcode.com/problems/binary-search/) +- [@video@Binary Search | Leet code 704 | Theory explained + Python code](https://www.youtube.com/watch?v=B7lMQIcIyN4) \ 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 index 8901d5294738..7f3f1bd33920 100644 --- 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 @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/) +- [@video@Binary Tree Level Order Traversal | Live Coding with Explanation](https://www.youtube.com/watch?v=vQrggrFMyp8) +- [@video@Binary Tree Level Order Traversal (BFS)](http://youtube.com/watch?v=2_tm34ZtYT4) \ 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 index 2708ec01a33b..d034ae5a8c81 100644 --- 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 @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Binary Tree Maximum Path Sum](https://leetcode.com/problems/binary-tree-maximum-path-sum/) +- [@video@Binary Tree Maximum Path Sum - LeetCode 124 - Python](https://www.youtube.com/watch?v=cfn-G-7vVlo) +- [@video@LeetCode 124. Binary Tree Maximum Path Sum](https://www.youtube.com/watch?v=mOdetMWwtoI) \ 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 index 0bddb052e172..bc7cd27d68d7 100644 --- a/src/data/roadmaps/leetcode/content/bit-manipulation@VIXFdmkwl9vw6LyxxoT74.md +++ b/src/data/roadmaps/leetcode/content/bit-manipulation@VIXFdmkwl9vw6LyxxoT74.md @@ -1,3 +1,9 @@ -# Stage 17 — Bit Manipulation +# 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 +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. + +Visit the following resources to learn more: + +- [@article@Bit manipulation](https://cp-algorithms.com/algebra/bit-manipulation.html) +- [@video@Algorithms: Bit Manipulation](https://www.youtube.com/watch?v=NLKQEOgBAnw) +- [@video@Bitwise Operators and WHY we use them](https://www.youtube.com/watch?v=igIjGxF2J-w) \ 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 index 547c87f18326..c1a1d4d91210 100644 --- a/src/data/roadmaps/leetcode/content/burst-balloons@ImPbL26vNvxvPm4Kg5Vpl.md +++ b/src/data/roadmaps/leetcode/content/burst-balloons@ImPbL26vNvxvPm4Kg5Vpl.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Burst Balloons](https://leetcode.com/problems/burst-balloons/) +- [@video@Minimum Number of Arrows to Burst Balloons](https://www.youtube.com/watch?v=lPmkKnvNPrw) +- [@video@Understand LeetCode 312. Burst Balloons in 6 minutes](https://www.youtube.com/watch?v=o3-PUPXiVfI) \ 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 index 04cd229ca67d..fb5f22a30900 100644 --- a/src/data/roadmaps/leetcode/content/c@IWmq4UFB5j6O3UJfarh1u.md +++ b/src/data/roadmaps/leetcode/content/c@IWmq4UFB5j6O3UJfarh1u.md @@ -1,3 +1,7 @@ # 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 +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. + +Visit the following resources to learn more: + +- [@roadmap@Visit the Dedicated C++ Roadmap](https://roadmap.sh/cpp) \ 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 index cdb092b2efd4..82e0cfa700b7 100644 --- a/src/data/roadmaps/leetcode/content/character-replacement@aLQVocF91X1-IrTP7Vb_b.md +++ b/src/data/roadmaps/leetcode/content/character-replacement@aLQVocF91X1-IrTP7Vb_b.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Longest Repeating Character Replacement](https://leetcode.com/problems/longest-repeating-character-replacement/) +- [@video@LeetCode Longest Repeating Character Replacement Solution](https://www.youtube.com/watch?v=00FmUN1pkGE) +- [@video@Longest Repeating Character Replacement - Leetcode 424](https://www.youtube.com/watch?v=tkNWKvxI3mU) \ 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 index dffd638aa17d..e54634ca2a15 100644 --- 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 @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Cheapest Flights Within K Stops](https://leetcode.com/problems/cheapest-flights-within-k-stops/) +- [@video@LeetCode 787. Cheapest Flights Within K Stops](https://www.youtube.com/watch?v=vWgoPTvQ3Rw) +- [@video@Leetcode - Cheapest Flights Within K Stops (Python)](https://www.youtube.com/watch?v=Jbb9qNIAyg0) \ 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 index 61a55de46d18..f03e5daee964 100644 --- a/src/data/roadmaps/leetcode/content/climbing-stairs@bXcvRnpO1aVN8XLLTSghB.md +++ b/src/data/roadmaps/leetcode/content/climbing-stairs@bXcvRnpO1aVN8XLLTSghB.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Climbing Stairs](https://leetcode.com/problems/climbing-stairs/) +- [@video@Climbing Stairs - Leetcode 70 - Dynamic Programming (Python)](https://www.youtube.com/watch?v=I-R1XsECJu8) +- [@video@Climbing Stairs - LeetCode 70 - JavaScript](https://www.youtube.com/watch?v=Ifek5h5VqJw) \ 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 index 4ba52a6ca283..0c8b0f22f674 100644 --- a/src/data/roadmaps/leetcode/content/clone-graph@WO238sUhvIiZHdLF6Kmfl.md +++ b/src/data/roadmaps/leetcode/content/clone-graph@WO238sUhvIiZHdLF6Kmfl.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Clone Graph](https://leetcode.com/problems/clone-graph/) +- [@video@Clone Graph - LeetCode 133 - Python](https://www.youtube.com/watch?v=2Qzj0t8nrCk) +- [@video@Clone Graph - Leetcode 133 - Graphs (Python)](https://www.youtube.com/watch?v=wWE7YzuBBkE) \ 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 index 570597a47af9..50a31cced0bc 100644 --- a/src/data/roadmaps/leetcode/content/coin-change@WtOHLWoHNkE9JdxtmBlwC.md +++ b/src/data/roadmaps/leetcode/content/coin-change@WtOHLWoHNkE9JdxtmBlwC.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Coin Change](https://leetcode.com/problems/coin-change/) +- [@video@Coin Change Problem | Minimum Number Of Coins Needed](https://www.youtube.com/watch?v=KnWorqyDSLA) +- [@video@Coin Change - LeetCode 322 - Python - Visually Explained](https://www.youtube.com/watch?v=Z6fauIHQiUk) \ 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 index 07f4475e99f2..f3ab29e0014a 100644 --- a/src/data/roadmaps/leetcode/content/combination-sum@P0ODrjdYJGSHvn02sjWIe.md +++ b/src/data/roadmaps/leetcode/content/combination-sum@P0ODrjdYJGSHvn02sjWIe.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Combination Sum](https://leetcode.com/problems/combination-sum/) +- [@video@LEETCODE 39 COMBINATION SUM](https://www.youtube.com/watch?v=uaqDhPGR4ow) +- [@video@Combination Sum - Leetcode 39 - Recursive Backtracking](https://www.youtube.com/watch?v=utBw5FbYswk) \ 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 index 1ca201f69529..debe7b62562b 100644 --- a/src/data/roadmaps/leetcode/content/container-with-most-water@YxfJQl5bHYnhryt9RooV0.md +++ b/src/data/roadmaps/leetcode/content/container-with-most-water@YxfJQl5bHYnhryt9RooV0.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Container With Most Water - LeetCode](https://leetcode.com/problems/container-with-most-water/description/) +- [@video@Container With Most Water - Leetcode 11](https://www.youtube.com/watch?v=Y_4_or0Sc7I) +- [@video@Container With Most Water | Detailed Explanation](https://www.youtube.com/watch?v=mVkyZzmuQmg) \ 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 index d8dd1e09691f..2a29beb59e1e 100644 --- a/src/data/roadmaps/leetcode/content/contains-duplicate@_wCmBewDz7Qb21u8HSZtp.md +++ b/src/data/roadmaps/leetcode/content/contains-duplicate@_wCmBewDz7Qb21u8HSZtp.md @@ -1,3 +1,8 @@ # 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 +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 following resources to learn more: + +- [@article@Contains Duplicate - LeetCode](https://leetcode.com/problems/contains-duplicate/description/) +- [@video@Contains Duplicate](https://www.youtube.com/watch?v=a1_r3cLQ6wg) \ 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 index 9d66f4601caa..68469e81734d 100644 --- a/src/data/roadmaps/leetcode/content/counting-bits@jZscKonByp5QDMcXUA50W.md +++ b/src/data/roadmaps/leetcode/content/counting-bits@jZscKonByp5QDMcXUA50W.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Counting Bits](https://leetcode.com/problems/counting-bits/) +- [@video@Counting Bits - LeetCode 338 - Python](https://www.youtube.com/watch?v=AACAzLKE9MI) +- [@video@Counting Bits | Leetcode #338](https://www.youtube.com/watch?v=awxaRgUB4Kw) \ 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 index 3ae9fdedc721..59893a33a742 100644 --- a/src/data/roadmaps/leetcode/content/course-schedule@CLOI_M9A3D1UFavCYKCSE.md +++ b/src/data/roadmaps/leetcode/content/course-schedule@CLOI_M9A3D1UFavCYKCSE.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Course Schedule](https://leetcode.com/problems/course-schedule/) +- [@video@LeetCode 207: Course Schedule | Topological Sort](https://www.youtube.com/watch?v=EUDwWbvtB_Q) +- [@video@Course Schedule (Detecting Cycles in a Graph)](https://www.youtube.com/watch?v=nz5V5pOiT8w) \ 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 index a6176e15034a..3455a4bc32fa 100644 --- a/src/data/roadmaps/leetcode/content/daily-temperatures@pMCIlFk-XfN91VNYtWjXq.md +++ b/src/data/roadmaps/leetcode/content/daily-temperatures@pMCIlFk-XfN91VNYtWjXq.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Daily Temperatures - LeetCode](https://leetcode.com/problems/daily-temperatures/description/) +- [@video@Daily Temperatures (LeetCode 739)](https://www.youtube.com/watch?v=ekFs9Nb2RNQ) +- [@video@Daily Temperatures - Leetcode 739](https://www.youtube.com/watch?v=_ZEvmycwXHs) \ 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 index 33164bb8aa3c..10fcf830da44 100644 --- 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 @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Design Add and Search Words](https://leetcode.com/problems/design-add-and-search-words-data-structure/) +- [@video@Design Add And Search Word Data Structure](https://www.youtube.com/watch?v=zDyoxl29yns) +- [@video@Design Add and Search Words Data Structure | Made Easy](https://www.youtube.com/watch?v=wyUO7Oq9uS4) \ 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 index ddd1240cf1c7..d851ba9c4009 100644 --- a/src/data/roadmaps/leetcode/content/edit-distance@xemUw3R72U4hvgHSOcaMg.md +++ b/src/data/roadmaps/leetcode/content/edit-distance@xemUw3R72U4hvgHSOcaMg.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Edit Distance](https://leetcode.com/problems/edit-distance/) +- [@video@Edit Distance (LeetCode 72) | Full step by step solution](https://www.youtube.com/watch?v=HwDXH35lr0o) +- [@video@Edit Distance - LeetCode 72 - Python - Visually Explained](https://www.youtube.com/watch?v=c3KYnQ-VEhs) \ 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 index 1d64e486e4c3..d2cb2704e643 100644 --- 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 @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Find Median from Data Stream](https://leetcode.com/problems/find-median-from-data-stream/) +- [@video@Find Median from Data Stream | Detailed Explanation](https://www.youtube.com/watch?v=jnj87BSi9Is) +- [@video@Find Median from Data Stream: Real-Time Median with Heaps](https://www.youtube.com/watch?v=SdURPlHqc1g) \ 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 index ae302bc9f110..6af1a3dae267 100644 --- a/src/data/roadmaps/leetcode/content/gas-station@UWJLu3cfCGo487MOeu63T.md +++ b/src/data/roadmaps/leetcode/content/gas-station@UWJLu3cfCGo487MOeu63T.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Gas Station](https://leetcode.com/problems/gas-station/) +- [@video@L82. Gas Station | Greedy Approach | Leetcode 134](https://www.youtube.com/watch?v=SmTow5Ht4iU) +- [@video@LeetCode 134 | Gas Station Problem Visually Explained](https://www.youtube.com/watch?v=9h-2YiTNam4) \ 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 index d2db7839da19..9221f9f95acd 100644 --- a/src/data/roadmaps/leetcode/content/generate-parentheses@-dW4-xzasJY2CrwS2PyhN.md +++ b/src/data/roadmaps/leetcode/content/generate-parentheses@-dW4-xzasJY2CrwS2PyhN.md @@ -1,3 +1,9 @@ # 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 +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 between stack and backtracking thinking and teaches you to use constraints to prune the search space before exploring it. + +Visit the following resources to learn more: + +- [@article@Generate Parentheses - LeetCode](https://leetcode.com/problems/generate-parentheses/description/) +- [@video@LeetCode 22. Generate Parentheses](https://www.youtube.com/watch?v=qBbZ3tS0McI) +- [@video@Generate Parentheses - Leetcode 22](https://www.youtube.com/watch?v=oC4saZRNwfI) \ 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 index 4c771642abf8..98f0a5c84e12 100644 --- a/src/data/roadmaps/leetcode/content/go@OkdM_PJge70j5tsjT2Esl.md +++ b/src/data/roadmaps/leetcode/content/go@OkdM_PJge70j5tsjT2Esl.md @@ -1,3 +1,7 @@ # 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 +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. + +Visit the following resources to learn more: + +- [@roadmap@Visit the Dedicated Go Roadmap](https://roadmap.sh/golang) \ 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 index 05bbaee4f379..9384a2816eb8 100644 --- a/src/data/roadmaps/leetcode/content/graphs@ssT7KZITndEvfyqmjeclx.md +++ b/src/data/roadmaps/leetcode/content/graphs@ssT7KZITndEvfyqmjeclx.md @@ -1,3 +1,8 @@ -# Stage 11 — Graphs +# 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 +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. + +Visit the following resources to learn more: + +- [@article@Graphs DSA](https://www.w3schools.com/dsa/dsa_theory_graphs.php) +- [@video@Learn Graphs in 5 minutes 🌐](https://www.youtube.com/watch?v=-VgHk7UMPP4) \ 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 index 44617e906e35..7dfa5bf28a67 100644 --- a/src/data/roadmaps/leetcode/content/greedy@MU6i1n0KKiAU_FkBTB3hW.md +++ b/src/data/roadmaps/leetcode/content/greedy@MU6i1n0KKiAU_FkBTB3hW.md @@ -1,3 +1,8 @@ -# Stage 15 — Greedy +# 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 +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. + +Visit the following resources to learn more: + +- [@article@DSA Greedy Algorithms](https://www.w3schools.com/dsa/dsa_ref_greedy.php) +- [@video@Greedy Algorithms Tutorial – Solve Coding Challenges](https://www.youtube.com/watch?v=bC7o8P_Ste4) \ 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 index 19c4d52ca070..eb37410ebbf6 100644 --- a/src/data/roadmaps/leetcode/content/group-anagrams@p7_B-NIBlqyKzR2PkrVWC.md +++ b/src/data/roadmaps/leetcode/content/group-anagrams@p7_B-NIBlqyKzR2PkrVWC.md @@ -1,3 +1,8 @@ # 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 +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 following resources to learn more: + +- [@article@Group Anagrams - LeetCode](https://leetcode.com/problems/group-anagrams/description/) +- [@video@Group Anagrams](https://www.youtube.com/watch?v=eDmxPfVa81k) \ 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 index f69270a3900b..79f4637a9b41 100644 --- a/src/data/roadmaps/leetcode/content/happy-number@VVB6zLZG6IxB4LQg8jIYT.md +++ b/src/data/roadmaps/leetcode/content/happy-number@VVB6zLZG6IxB4LQg8jIYT.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Happy Number](https://leetcode.com/problems/happy-number/) +- [@video@Happy Number - LeetCode 202 - Python](https://www.youtube.com/watch?v=8wDuRgQ2dvw) +- [@video@Happy Number (LeetCode 202) | Full solution](https://www.youtube.com/watch?v=LkD0D0Xy-ro) \ 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 index d30a7e79c018..b752e4588404 100644 --- a/src/data/roadmaps/leetcode/content/heap--priority-queue@mvcSC0kFiD0AT5a2ffU5l.md +++ b/src/data/roadmaps/leetcode/content/heap--priority-queue@mvcSC0kFiD0AT5a2ffU5l.md @@ -1,3 +1,9 @@ -# Stage 8 — Heap and Priority Queue +# Heaps 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 +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. + +Visit the following resources to learn more: + +- [@article@Priority Queue](https://www.programiz.com/dsa/priority-queue) +- [@video@Learn Priority Queue data structures in 5 minutes 🥇](https://www.youtube.com/watch?v=7z_HXFZqXqc) +- [@video@Heaps in 3 minutes — Intro](https://www.youtube.com/watch?v=0wPlzMU-k00) \ 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 index 171d4df5e598..0c93ef785c94 100644 --- a/src/data/roadmaps/leetcode/content/house-robber@GeLGoM3ocxZ-gjMUes4sE.md +++ b/src/data/roadmaps/leetcode/content/house-robber@GeLGoM3ocxZ-gjMUes4sE.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@House Robber](https://leetcode.com/problems/house-robber/) +- [@video@House Robber - LeetCode 198 - Python](https://www.youtube.com/watch?v=r-ib63mhrNM) +- [@video@House Robber - Leetcode 198 - Dynamic Programming (Python)](https://www.youtube.com/watch?v=kIII1uT6F8Y) \ 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 index 25833de1b988..7ec31a3dea4b 100644 --- a/src/data/roadmaps/leetcode/content/implement-trie@_zumaNoKiaD4zS3wntAsd.md +++ b/src/data/roadmaps/leetcode/content/implement-trie@_zumaNoKiaD4zS3wntAsd.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Implement Trie](https://leetcode.com/problems/implement-trie-prefix-tree/) +- [@video@Implement Trie (Prefix Tree) - LeetCode 202 - Python](https://www.youtube.com/watch?v=1YmGVaGb-Gc) +- [@video@Implement Trie (Prefix Tree) - Trees (Python)](https://www.youtube.com/watch?v=8mhw5WT2x0U) \ 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 index 9a67faeb4077..088cfaab80a7 100644 --- a/src/data/roadmaps/leetcode/content/insert-interval@BhiAYH1ug08LnPH8DtR1D.md +++ b/src/data/roadmaps/leetcode/content/insert-interval@BhiAYH1ug08LnPH8DtR1D.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Insert Interval](https://leetcode.com/problems/insert-interval/) +- [@video@Insert Interval - LeetCode 57 - Python](https://www.youtube.com/watch?v=bx261hofOyk) +- [@video@Insert Interval (LeetCode 57) Full solution with different scenarios](https://www.youtube.com/watch?v=wCBtjZxw1xY) \ 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 index f7bace42c84c..9d23869589c8 100644 --- a/src/data/roadmaps/leetcode/content/intervals@zHDAHN1gN5Ofx2eyQg5_7.md +++ b/src/data/roadmaps/leetcode/content/intervals@zHDAHN1gN5Ofx2eyQg5_7.md @@ -1,3 +1,7 @@ -# Stage 16 — Intervals +# 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 +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. + +Visit the following resources to learn more: + +- [@article@DSA Fundamentals: Intervals - From Theory to LeetCode Practice](https://www.jaykye.dev/blog/dsa-intervals-fundamentals) \ 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 index 8d9a40929404..44b948454af9 100644 --- a/src/data/roadmaps/leetcode/content/java@gjZZOwmYkXQHPfg9Ynz80.md +++ b/src/data/roadmaps/leetcode/content/java@gjZZOwmYkXQHPfg9Ynz80.md @@ -1,3 +1,7 @@ # 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 +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. + +Visit the following resources to learn more: + +- [@roadmap@Visit the Dedicated Java Roadmap](https://roadmap.sh/java) \ 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 index ada2b259063f..8a115559957b 100644 --- a/src/data/roadmaps/leetcode/content/javascript@HVD9G3JlLBsAg111vQILj.md +++ b/src/data/roadmaps/leetcode/content/javascript@HVD9G3JlLBsAg111vQILj.md @@ -1,3 +1,7 @@ # 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 +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. + +Visit the following resources to learn more: + +- [@roadmap@Visit the Dedicated JavaScript Roadmap](https://roadmap.sh/javascript) \ 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 index 4521324986a0..c4fbe1791117 100644 --- a/src/data/roadmaps/leetcode/content/jump-game-ii@gJ1O1H12KoNejTV_q0dsf.md +++ b/src/data/roadmaps/leetcode/content/jump-game-ii@gJ1O1H12KoNejTV_q0dsf.md @@ -1,3 +1,9 @@ # 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 +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/). + +Visit the following resources to learn more: + +- [@article@Jump Game II](https://leetcode.com/problems/jump-game-ii/) +- [@video@PASS the coding interview | #45 Jump Game II (Leetcode)](https://www.youtube.com/watch?v=G8isnm2OylM) +- [@video@Jump Game II - Leetcode 45 - Recursive Backtracking (Python)](https://www.youtube.com/watch?v=CsDI-yQuGeM) \ 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 index 5ad7bad44689..e69d20bc76b8 100644 --- a/src/data/roadmaps/leetcode/content/jump-game@so5popgQyB5vNRz_NYxo6.md +++ b/src/data/roadmaps/leetcode/content/jump-game@so5popgQyB5vNRz_NYxo6.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Jump Game](https://leetcode.com/problems/jump-game/) +- [@video@LeetCode 55. Jump Game (Algorithm Explained)](https://www.youtube.com/watch?v=Zb4eRjuPHbM) +- [@video@Jump Game (LeetCode 55) | Full solution](https://www.youtube.com/watch?v=Gtugy3mRV-A) \ 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 index 8461aee75d25..d390e4158950 100644 --- 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 @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@K Closest Points to Origin](https://leetcode.com/problems/k-closest-points-to-origin/) +- [@video@K Closest Points to Origin | Leetcode #973](https://www.youtube.com/watch?v=VORIA407dB4) +- [@video@K Closest Points to Origin - Leetcode 973 - Heaps (Python)](https://www.youtube.com/watch?v=IGRUukbD6p8) \ 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 index 710dd303b3bb..b1b0cac18d3d 100644 --- a/src/data/roadmaps/leetcode/content/koko-eating-bananas@wyU9wyyQ54KgMeRsbS9AM.md +++ b/src/data/roadmaps/leetcode/content/koko-eating-bananas@wyU9wyyQ54KgMeRsbS9AM.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Koko Eating Bananas](https://leetcode.com/problems/koko-eating-bananas/) +- [@video@Koko Eating Bananas](https://www.youtube.com/watch?v=JGYXNpZaW2U) +- [@video@BS-12. Koko Eating Bananas](https://www.youtube.com/watch?v=qyfekrNni90) \ 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 index b20459b7baa7..7154f7d8d009 100644 --- 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 @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/) +- [@video@Kth Largest Element in an Array](https://www.youtube.com/watch?v=dXV83KXt7KA) +- [@video@Kth Largest Element in an Array - Heaps (Python)](https://www.youtube.com/watch?v=ZmGk7h8KZLs) \ 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 index 6bab75ed470a..19c41fcebb24 100644 --- a/src/data/roadmaps/leetcode/content/largest-rectangle-in-hist@zLM5eW7hZ7TrUzyNpvMyG.md +++ b/src/data/roadmaps/leetcode/content/largest-rectangle-in-hist@zLM5eW7hZ7TrUzyNpvMyG.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Largest Rectangle in Histogram - LeetCode](https://leetcode.com/problems/largest-rectangle-in-histogram/description/) +- [@video@Largest Rectangle in Histogram](https://www.youtube.com/watch?v=ZGMw8Bvpwd4) +- [@video@L12. Largest Rectangle in Histogram | Stack and Queue Playlist](https://www.youtube.com/watch?v=Bzat9vgD0fs) \ 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 index 32e6962148ce..6eec2c522257 100644 --- a/src/data/roadmaps/leetcode/content/linked-list-cycle@qAWeeYfvFD8-LTZgZ2LVa.md +++ b/src/data/roadmaps/leetcode/content/linked-list-cycle@qAWeeYfvFD8-LTZgZ2LVa.md @@ -1,3 +1,9 @@ # 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 +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 the other move two steps at a time; if there is a cycle, they will eventually meet. This problem introduces the fast-and-slow-pointer pattern, which is used in several more advanced linked list problems. + +Visit the following resources to learn more: + +- [@article@Linked List Cycle](https://leetcode.com/problems/linked-list-cycle/) +- [@video@LeetCode Linked List Cycle Solution Explained - Java](https://www.youtube.com/watch?v=6OrZ4wAy4uE) +- [@video@Linked List Cycle - Leetcode 141 - Linked Lists (Python)](https://www.youtube.com/watch?v=y-ckZ2hpC8Y) \ 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 index 90ea41eb8b8b..184bf9f90760 100644 --- a/src/data/roadmaps/leetcode/content/linked-list@lDT9PtNMP8lSdeH7EVBoH.md +++ b/src/data/roadmaps/leetcode/content/linked-list@lDT9PtNMP8lSdeH7EVBoH.md @@ -1,3 +1,9 @@ -# Stage 6 — Linked List +# 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 +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. + +Visit the following resources to learn more: + +- [@article@DSA Linked Lists](https://www.w3schools.com/dsa/dsa_theory_linkedlists.php) +- [@article@Understanding Linked Lists: A Beginner’s Guide](https://medium.com/@ogundipe.eniola/understanding-linked-lists-a-beginners-guide-a7ca6aa6ee04) +- [@video@Learn Linked Lists in 13 minutes 🔗](https://www.youtube.com/watch?v=N6dOwBde7-M) \ 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 index 196cd61b1743..8e3b5793c722 100644 --- a/src/data/roadmaps/leetcode/content/longest-common-prefix@8HrT_SZWMlscj13G0gIID.md +++ b/src/data/roadmaps/leetcode/content/longest-common-prefix@8HrT_SZWMlscj13G0gIID.md @@ -1,3 +1,9 @@ # 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 +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 it teaches you that tries are not only for search, they also encode shared structure between strings. + +Visit the following resources to learn more: + +- [@article@Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/) +- [@video@Longest Common Prefix - Leetcode 14 - Arrays & Strings (Python)](https://www.youtube.com/watch?v=8C6F8_nM0qs) +- [@video@LeetCode 14. Longest Common Prefix Solution Explained - Java](https://www.youtube.com/watch?v=bl8ue-dTxgs) \ 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 index 187005965731..6618f6191e37 100644 --- a/src/data/roadmaps/leetcode/content/longest-common-subsequence@iodbhwYOWDM5JTaaqG4-m.md +++ b/src/data/roadmaps/leetcode/content/longest-common-subsequence@iodbhwYOWDM5JTaaqG4-m.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Longest Common Subsequence](https://leetcode.com/problems/longest-common-subsequence/) +- [@video@Longest Common Subsequence (LeetCode 1143)](https://www.youtube.com/watch?v=e9tUPwZZSBI) +- [@video@Longest Common Subsequence Problem Visually Explained](https://www.youtube.com/watch?v=4ClOkX0SWW4) \ 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 index 16cf051023ee..494036a25518 100644 --- a/src/data/roadmaps/leetcode/content/longest-increasing-subsequ@h9yvrxDYEZ9mCqbeKoPEu.md +++ b/src/data/roadmaps/leetcode/content/longest-increasing-subsequ@h9yvrxDYEZ9mCqbeKoPEu.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/) +- [@video@Longest Increasing Subsequence - Leetcode 300](https://www.youtube.com/watch?v=MrPa5EFcDCU) +- [@video@Longest Increasing Subsequence Problem Explained](https://www.youtube.com/watch?v=iQP5XFeXiMQ) \ 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 index a02e94e451ff..4f39eeebe355 100644 --- a/src/data/roadmaps/leetcode/content/lowest-common-ancestor@cHPRRjBTrznI6UBC-WQP6.md +++ b/src/data/roadmaps/leetcode/content/lowest-common-ancestor@cHPRRjBTrznI6UBC-WQP6.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Lowest Common Ancestor of a BST](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/) +- [@video@LOWEST COMMON ANCESTOR OF A BINARY TREE I](https://www.youtube.com/watch?v=WO1tfq2sbsI) +- [@video@Lowest Common Ancestor of a Binary Search Tree](https://www.youtube.com/watch?v=r6AXIfdi9oQ) \ 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 index 35df33ee08aa..e9c5fe421329 100644 --- a/src/data/roadmaps/leetcode/content/math--geometry@Rx59jh-ynzC5wRGja3jvg.md +++ b/src/data/roadmaps/leetcode/content/math--geometry@Rx59jh-ynzC5wRGja3jvg.md @@ -1,3 +1,7 @@ -# Stage 18 — Math and Geometry +# 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 +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? + +Visit the following resources to learn more: + +- [@article@Basic Geometry](https://cp-algorithms.com/geometry/basic-geometry.html) \ 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 index 756acfff0573..56c2bbf64c9c 100644 --- 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 @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/) +- [@video@LeetCode 104: Maximum Depth of Binary Tree | Recursive DFS](https://www.youtube.com/watch?v=p-eMCRpvbIY) +- [@video@Maximum Depth of Binary Tree - Leetcode 104 - Trees (Python)](https://www.youtube.com/watch?v=ScvTcU2Aifs) \ 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 index 2b3e2db3087f..80fa1d4cd244 100644 --- a/src/data/roadmaps/leetcode/content/median-of-two-arrays@kV9z7UQsYFMR6umo0fDM1.md +++ b/src/data/roadmaps/leetcode/content/median-of-two-arrays@kV9z7UQsYFMR6umo0fDM1.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) +- [@video@Median of Two Sorted Arrays Python Solution - LeetCode #4](https://www.youtube.com/watch?v=BhxyUWR_Efc) +- [@video@Median of Two Sorted Arrays](http://youtube.com/watch?v=eUvfNcHhi5o) \ 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 index 21ee9515da59..100509511668 100644 --- a/src/data/roadmaps/leetcode/content/meeting-rooms@9evXTNz1IVOnqWCQ7L5BW.md +++ b/src/data/roadmaps/leetcode/content/meeting-rooms@9evXTNz1IVOnqWCQ7L5BW.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Meeting Rooms](https://leetcode.com/problems/meeting-rooms/) +- [@video@Meeting Rooms - LeetCode 252 Python](https://www.youtube.com/watch?v=XI9L0HDl-No) +- [@video@Leetcode Premium - Intervals Interview Question](https://www.youtube.com/watch?v=5nqLIwo0oC0) \ 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 index fe6ff185ff91..7fd34a8d4547 100644 --- a/src/data/roadmaps/leetcode/content/merge-intervals@JsjPXTe3Zp5E7vCWUMeSe.md +++ b/src/data/roadmaps/leetcode/content/merge-intervals@JsjPXTe3Zp5E7vCWUMeSe.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Merge Intervals](https://leetcode.com/problems/merge-intervals/https://leetcode.com/problems/merge-intervals/) +- [@video@Merge Intervals - Leetcode 56 - Arrays & Strings (Python)](https://www.youtube.com/watch?v=HCbKvBOlMVI) +- [@video@Leetcode - Merge Intervals (Python)](https://www.youtube.com/watch?v=iT9_MU2L3H0) \ 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 index 998166f218dd..707eb114efb0 100644 --- 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 @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Merge K Sorted Lists](https://leetcode.com/problems/merge-k-sorted-lists/) +- [@video@Merge K Sorted Arrays - Min Heap Algorithm](https://www.youtube.com/watch?v=ptYUCjfNhJY) +- [@video@Merge K Sorted Linked Lists - Leetcode 23 - Heaps (Python)](https://www.youtube.com/watch?v=RyrVWP76lVo) \ 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 index d2ecfc74cf60..cf01cf68c4db 100644 --- a/src/data/roadmaps/leetcode/content/merge-k-sorted-lists@eHnN9thTtLPIUtz9Z28OL.md +++ b/src/data/roadmaps/leetcode/content/merge-k-sorted-lists@eHnN9thTtLPIUtz9Z28OL.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Merge K Sorted Lists](https://leetcode.com/problems/merge-k-sorted-lists/) +- [@video@Merge K Sorted Linked Lists - Leetcode 23 - Heaps (Python)](https://www.youtube.com/watch?v=RyrVWP76lVo) +- [@video@Merge K Sorted Arrays - Min Heap Algorithm](https://www.youtube.com/watch?v=ptYUCjfNhJY) \ 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 index 0cd16dc68da4..4c69cd030268 100644 --- a/src/data/roadmaps/leetcode/content/merge-two-sorted-lists@qEYz2Dj1hqLDBFWYX7XmE.md +++ b/src/data/roadmaps/leetcode/content/merge-two-sorted-lists@qEYz2Dj1hqLDBFWYX7XmE.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists/) +- [@video@LeetCode 21: Merge Two Sorted Lists (Visualization)](https://www.youtube.com/watch?v=E5XXiY6QnAs) +- [@video@Merge Two Sorted Lists - Leetcode 21 - Linked Lists (Python)](https://www.youtube.com/watch?v=5Rec4JS9H5o) \ 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 index 6f07bcaeed9b..dfd1b7b9b75d 100644 --- 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 @@ -1,3 +1,9 @@ # 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 +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. + +Visit the following resources to learn more: + +- [@article@Min Cost to Connect All Points](https://leetcode.com/problems/min-cost-to-connect-all-points/) +- [@video@Min Cost to Connect All Points | Prim's Algorithm |](https://www.youtube.com/watch?v=hsr7KolYDH0) +- [@video@Min Cost to Connect All Points (Prim's Algorithm to Create MST)](https://www.youtube.com/watch?v=8VPIrqwQ8sQ) \ 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 index 6256b2006126..4f0a75883dc9 100644 --- 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 @@ -1,3 +1,8 @@ # 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 +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 following resources to learn more: + +- [@article@Minimum Interval to Include Each Query](https://leetcode.com/problems/minimum-interval-to-include-each-query/) +- [@video@Minimum Interval to Include Each Query: 1851](https://www.youtube.com/watch?v=FZtDTYzVUhU) \ 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 index 8e9add66793f..2fb0f5d26eac 100644 --- a/src/data/roadmaps/leetcode/content/min-stack@XjJhO0gX0Dw8yF09TnJwK.md +++ b/src/data/roadmaps/leetcode/content/min-stack@XjJhO0gX0Dw8yF09TnJwK.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Min Stack - LeetCode](https://leetcode.com/problems/min-stack/description/) +- [@video@Min Stack (LeetCode 155)](https://www.youtube.com/watch?v=lkYzexIVlOY) +- [@video@Min Stack - Leetcode 155 - Stacks (Python)](https://www.youtube.com/watch?v=RfMroCV17-4) \ 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 index 4c5d9e818ef6..232d3ecbd851 100644 --- a/src/data/roadmaps/leetcode/content/minimum-in-rotated-array@XYTIX8oNH3qCmXjRbycDi.md +++ b/src/data/roadmaps/leetcode/content/minimum-in-rotated-array@XYTIX8oNH3qCmXjRbycDi.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) +- [@video@LeetCode 153. Find Minimum in Rotated Sorted Array](https://www.youtube.com/watch?v=IzHR_U8Ly6c) +- [@video@Find Minimum in Rotated Sorted Array](https://www.youtube.com/watch?v=H2U24n4bcQQ) \ 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 index 021e6a547bbb..a919449f74d4 100644 --- a/src/data/roadmaps/leetcode/content/minimum-window-substring@P7scdQHmNUPA6UI36yBtL.md +++ b/src/data/roadmaps/leetcode/content/minimum-window-substring@P7scdQHmNUPA6UI36yBtL.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Minimum Window Substring](https://leetcode.com/problems/minimum-window-substring/) +- [@video@Leetcode - Minimum Window Substring (Python)](https://www.youtube.com/watch?v=CX6_L9GLldU) +- [@video@L12. Minimum Window Substring](https://www.youtube.com/watch?v=WJaij9ffOIY) \ 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 index 2703779e356e..5280ff00ed0c 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@0u8IQZvJV7ORHcBfUBQ7R.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@0u8IQZvJV7ORHcBfUBQ7R.md @@ -2,8 +2,10 @@ 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 +Visit the following resources to learn more: + +- [@article@Multiply Strings](https://leetcode.com/problems/multiply-strings/) +- [@article@Detect Squares](https://leetcode.com/problems/detect-squares/) +- [@article@Plus One](https://leetcode.com/problems/plus-one/) +- [@article@Count Primes](https://leetcode.com/problems/count-primes/) +- [@article@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 index 321a7766db92..08c70062f237 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@2r0q7Gic8orJx2w28OH_I.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@2r0q7Gic8orJx2w28OH_I.md @@ -2,8 +2,10 @@ 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 +Visit the following resources to learn more: + +- [@article@Search a 2D Matrix](https://leetcode.com/problems/search-a-2d-matrix/) +- [@article@Time Based Key-Value Store](https://leetcode.com/problems/time-based-key-value-store/) +- [@article@Capacity to Ship Packages Within D Days](https://leetcode.com/problems/capacity-to-ship-packages-within-d-days/) +- [@article@Find First and Last Position of Element in Sorted Array](https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/) +- [@article@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 index ad881505d243..854c0b9057e4 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@2vhZHAKoFeNoi1utHcPPw.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@2vhZHAKoFeNoi1utHcPPw.md @@ -2,8 +2,10 @@ 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 +Visit the following resources to learn more: + +- [@article@Kth Largest Element in a Stream](https://leetcode.com/problems/kth-largest-element-in-a-stream/) +- [@article@Last Stone Weight](https://leetcode.com/problems/last-stone-weight/) +- [@article@Design Twitter](https://leetcode.com/problems/design-twitter/) +- [@article@Reorganize String](https://leetcode.com/problems/reorganize-string/) +- [@article@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 index f4075ffe5261..4cfff6bb808c 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@AMT2zQPDlKUm-d2vT1Sae.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@AMT2zQPDlKUm-d2vT1Sae.md @@ -2,8 +2,10 @@ 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 +Visit the following resources to learn more: + +- [@article@Permutation in String](https://leetcode.com/problems/permutation-in-string/) +- [@article@Fruits into Baskets](https://leetcode.com/problems/fruit-into-baskets/) +- [@article@Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/) +- [@article@Subarray Product Less Than K](https://leetcode.com/problems/subarray-product-less-than-k/) +- [@article@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 index 5c79f633b945..7ac9236f83fa 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@EBqzxy-2FWK4FwHyNKVHP.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@EBqzxy-2FWK4FwHyNKVHP.md @@ -2,8 +2,10 @@ 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 +Visit the following resources to learn more: + +- [@article@House Robber II](https://leetcode.com/problems/house-robber-ii/) +- [@article@Decode Ways](https://leetcode.com/problems/decode-ways/) +- [@article@Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/) +- [@article@Partition Equal Subset Sum](https://leetcode.com/problems/partition-equal-subset-sum/) +- [@article@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 index ce7d6d18884d..0de27f9cd479 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@G1SqIZkN9dBKsv2LxqP8D.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@G1SqIZkN9dBKsv2LxqP8D.md @@ -2,8 +2,10 @@ 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 +Visit the following resources to learn more: + +- [@article@Subsets II](https://leetcode.com/problems/subsets-ii/) +- [@article@Combination Sum II](https://leetcode.com/problems/combination-sum-ii/) +- [@article@Palindrome Partitioning](https://leetcode.com/problems/palindrome-partitioning/) +- [@article@Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) +- [@article@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 index cfeeefe698dd..6057c90c327a 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@JtV6pQzvcXFoNG01tx9pq.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@JtV6pQzvcXFoNG01tx9pq.md @@ -1,9 +1,11 @@ -# More Excersises +# More Exercises 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 +Visit the following resources to learn more: + +- [@article@Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/) +- [@article@Valid Sudoku](https://leetcode.com/problems/valid-sudoku/) +- [@article@Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/) +- [@article@Encode and Decode Strings](https://leetcode.com/problems/encode-and-decode-strings/) +- [@article@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 index cd11d2b14db4..76deec100100 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@KHLCYCZqfXqVlHAs7YVHv.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@KHLCYCZqfXqVlHAs7YVHv.md @@ -2,8 +2,10 @@ 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 +Visit the following resources to learn more: + +- [@article@Hand of Straights](https://leetcode.com/problems/hand-of-straights/) +- [@article@Merge Triplets to Form Target Triplet](https://leetcode.com/problems/merge-triplets-to-form-a-target-triplet/) +- [@article@Valid Parenthesis String](https://leetcode.com/problems/valid-parenthesis-string/) +- [@article@Candy](https://leetcode.com/problems/candy/) +- [@article@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 index 024419e30f06..04dd4e4b6ee2 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@NFOzXHoSHj1_2_isVifsY.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@NFOzXHoSHj1_2_isVifsY.md @@ -2,8 +2,10 @@ 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 +Visit the following resources to learn more: + +- [@article@Sort Colors](https://leetcode.com/problems/sort-colors/) +- [@article@Move Zeroes](https://leetcode.com/problems/move-zeroes/) +- [@article@Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) +- [@article@Boats to Save People](https://leetcode.com/problems/boats-to-save-people/) +- [@article@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 index ed4354970742..dbea298dd308 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@Q-vNw7YUh-4U6im7nrHe8.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@Q-vNw7YUh-4U6im7nrHe8.md @@ -2,8 +2,10 @@ 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 +Visit the following resources to learn more: + +- [@article@Meeting Rooms II](https://leetcode.com/problems/meeting-rooms-ii/) +- [@article@Employee Free Time](https://leetcode.com/problems/employee-free-time/) +- [@article@Car Pooling](https://leetcode.com/problems/car-pooling/) +- [@article@Interval List Intersections](https://leetcode.com/problems/interval-list-intersections/) +- [@article@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 index 4800855ec5e7..ffa49e73bce7 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@Q0AxfKbRuyY5rY2pO5xcP.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@Q0AxfKbRuyY5rY2pO5xcP.md @@ -2,8 +2,10 @@ 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 +Visit the following resources to learn more: + +- [@article@Max Area of Island](https://leetcode.com/problems/max-area-of-island/) +- [@article@Rotting Oranges](https://leetcode.com/problems/rotting-oranges/) +- [@article@Course Schedule II](https://leetcode.com/problems/course-schedule-ii/) +- [@article@Redundant Connection](https://leetcode.com/problems/redundant-connection/) +- [@article@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 index e3bc787834f3..6a17d08f97bf 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@Ur6eSm0t-jQD2j710Vc89.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@Ur6eSm0t-jQD2j710Vc89.md @@ -2,8 +2,10 @@ 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 +Visit the following resources to learn more: + +- [@article@Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) +- [@article@Copy List With Random Pointer](https://leetcode.com/problems/copy-list-with-random-pointer/) +- [@article@Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) +- [@article@LRU Cache](https://leetcode.com/problems/lru-cache/) +- [@article@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 index 9f4587baf6d7..882862f1b69e 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@VpquOgXr8OG_jLkeDSk3H.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@VpquOgXr8OG_jLkeDSk3H.md @@ -2,8 +2,10 @@ 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 +Visit the following resources to learn more: + +- [@article@Evaluate Reverse Polish Notation](https://leetcode.com/problems/evaluate-reverse-polish-notation/) +- [@article@Car Fleet](https://leetcode.com/problems/car-fleet/) +- [@article@Asteroid Collision](https://leetcode.com/problems/asteroid-collision/) +- [@article@Remove K Digits](https://leetcode.com/problems/remove-k-digits/) +- [@article@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 index 28ccc2b5c970..e7f809b77be9 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@XjViEOLzyd_BK9dhgNtdK.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@XjViEOLzyd_BK9dhgNtdK.md @@ -2,8 +2,10 @@ 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 +Visit the following resources to learn more: + +- [@article@Invert Binary Tree](https://leetcode.com/problems/invert-binary-tree/) +- [@article@Diameter of Binary Tree](https://leetcode.com/problems/diameter-of-binary-tree/) +- [@article@Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) +- [@article@Binary Tree Right Side View](https://leetcode.com/problems/binary-tree-right-side-view/) +- [@article@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 index 05595e3f01d4..9dce71e1bea5 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@awYK5VUD2HS9ywJQfFYU7.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@awYK5VUD2HS9ywJQfFYU7.md @@ -2,8 +2,10 @@ 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 +Visit the following resources to learn more: + +- [@article@Missing Number](https://leetcode.com/problems/missing-number/) +- [@article@Reverse Integer](https://leetcode.com/problems/reverse-integer/) +- [@article@Power of Two](https://leetcode.com/problems/power-of-two/) +- [@article@Bitwise AND of Numbers Range](https://leetcode.com/problems/bitwise-and-of-numbers-range/) +- [@article@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 index 7690a3627f0e..1245ca5bce86 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@i4A57jKrkhlw-jW3i3HSi.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@i4A57jKrkhlw-jW3i3HSi.md @@ -2,8 +2,10 @@ 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 +Visit the following resources to learn more: + +- [@article@Alien Dictionary](https://leetcode.com/problems/alien-dictionary/) +- [@article@Path with Maximum Probability](https://leetcode.com/problems/path-with-maximum-probability/) +- [@article@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/) +- [@article@Minimum Spanning Tree](https://leetcode.com/problems/connecting-cities-with-minimum-cost/) +- [@article@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 index 8921ad238633..f0f17a261e60 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@licG83FALxf4jPOV7v_an.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@licG83FALxf4jPOV7v_an.md @@ -2,8 +2,10 @@ 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 +Visit the following resources to learn more: + +- [@article@Best Time to Buy and Sell Stock with Cooldown](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/) +- [@article@Coin Change II](https://leetcode.com/problems/coin-change-ii/) +- [@article@Target Sum](https://leetcode.com/problems/target-sum/) +- [@article@Interleaving String](https://leetcode.com/problems/interleaving-string/) +- [@article@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 index 4e0cbebded8f..4937a40a6bc6 100644 --- a/src/data/roadmaps/leetcode/content/more-excersises@y-quVGz8J5Rmz2ixUFwBI.md +++ b/src/data/roadmaps/leetcode/content/more-excersises@y-quVGz8J5Rmz2ixUFwBI.md @@ -2,8 +2,10 @@ 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 +Visit the following resources to learn more: + +- [@article@Extra Characters in a String](https://leetcode.com/problems/extra-characters-in-a-string/) +- [@article@Sum of Prefix Scores of Strings](https://leetcode.com/problems/sum-of-prefix-scores-of-strings/) +- [@article@Palindrome Pairs](https://leetcode.com/problems/palindrome-pairs/) +- [@article@Index Pairs of a String](https://leetcode.com/problems/index-pairs-of-a-string/) +- [@article@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 index 603bf2ff20f2..e1ea13e84528 100644 --- a/src/data/roadmaps/leetcode/content/n-queens@fBtsnKP5n3WBjMycwIfir.md +++ b/src/data/roadmaps/leetcode/content/n-queens@fBtsnKP5n3WBjMycwIfir.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@N-Queens](https://leetcode.com/problems/n-queens/) +- [@video@N-Queens Problem | using Backtracking | Leetcode Hard](https://www.youtube.com/watch?v=BdSJnIdR-4s) +- [@video@The N Queens Problem using Backtracking/Recursion](https://www.youtube.com/watch?v=wGbuCyNpxIg) \ 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 index face2bb8bce6..348f8bb1863b 100644 --- a/src/data/roadmaps/leetcode/content/network-delay-time@zSqCHDbPvWsDRtEURoVNK.md +++ b/src/data/roadmaps/leetcode/content/network-delay-time@zSqCHDbPvWsDRtEURoVNK.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Network Delay Time](https://leetcode.com/problems/network-delay-time/) +- [@video@Network Delay Time (Djikstra's Algorithm)](https://www.youtube.com/watch?v=Bp7STMWMMQw) +- [@video@Network Delay Time | Leetcode #743](https://www.youtube.com/watch?v=YHx6r9pM5e0) \ 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 index 9256a98ec9fb..7baeb8f8bdda 100644 --- a/src/data/roadmaps/leetcode/content/non-overlapping-intervals@Mc1jQ5_-trqgCckM23cjQ.md +++ b/src/data/roadmaps/leetcode/content/non-overlapping-intervals@Mc1jQ5_-trqgCckM23cjQ.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Non-overlapping Intervals](https://leetcode.com/problems/non-overlapping-intervals/) +- [@video@Non-overlapping Intervals - LeetCode 435 - Python](https://www.youtube.com/watch?v=2LUQ6tBdGxo) +- [@video@Non-overlapping Intervals (LeetCode 435)](https://www.youtube.com/watch?v=XsrJgwGlRoc) \ 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 index bcadfa7b98bd..ba67ee8a35d8 100644 --- a/src/data/roadmaps/leetcode/content/non-overlapping-intervals@k0XOp6P-EIyRKrSbsgr0w.md +++ b/src/data/roadmaps/leetcode/content/non-overlapping-intervals@k0XOp6P-EIyRKrSbsgr0w.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Non-overlapping Intervals](https://leetcode.com/problems/non-overlapping-intervals/) +- [@video@Non-overlapping Intervals (LeetCode 435)](https://www.youtube.com/watch?v=XsrJgwGlRoc) +- [@video@Non-overlapping Intervals - LeetCode 435](https://www.youtube.com/watch?v=2LUQ6tBdGxo) \ 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 index 6f6398d47fed..07964615eac0 100644 --- 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 @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Number of 1 Bits](https://leetcode.com/problems/number-of-1-bits/) +- [@video@Number of 1 Bits | Live Coding with Explanation | Leetcode - 191](https://www.youtube.com/watch?v=wLHhAHkID9M) +- [@video@Number of 1 Bits - Leetcode 191 - Bit Manipulation (Python)](https://www.youtube.com/watch?v=1JfdvPk-iHg) \ 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 index afd2ab94936f..d145c8898986 100644 --- a/src/data/roadmaps/leetcode/content/number-of-islands@LInRfygQmBDTFbezzM97o.md +++ b/src/data/roadmaps/leetcode/content/number-of-islands@LInRfygQmBDTFbezzM97o.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Number of Islands](https://leetcode.com/problems/number-of-islands/) +- [@video@Number of Islands (LeetCode 200) | Full solution](https://www.youtube.com/watch?v=ZgCZfXPo3hI) +- [@video@Number of Islands - Leetcode 200 - Graphs (Python)](https://www.youtube.com/watch?v=gCswsDauXPc) \ 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 index da77bd09f50f..97396687497e 100644 --- a/src/data/roadmaps/leetcode/content/pacific-atlantic-water-flow@mhSb4eQV970bLlOfFg84p.md +++ b/src/data/roadmaps/leetcode/content/pacific-atlantic-water-flow@mhSb4eQV970bLlOfFg84p.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Pacific Atlantic Water Flow](https://leetcode.com/problems/pacific-atlantic-water-flow/) +- [@video@Pacific Atlantic Water Flow - Leetcode 417 - Graphs (Python)](https://www.youtube.com/watch?v=pDvvDvgHUKE) +- [@video@[Java] Leetcode 417. Pacific Atlantic Water Flow [Search #4]](https://www.youtube.com/watch?v=ZQp1oGp1y6s) \ 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 index fd29dbaf870e..8b4da41358a0 100644 --- a/src/data/roadmaps/leetcode/content/partition-labels@V7pvMzno_woUHHSfLTv7q.md +++ b/src/data/roadmaps/leetcode/content/partition-labels@V7pvMzno_woUHHSfLTv7q.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Partition Labels](https://leetcode.com/problems/partition-labels/) +- [@video@Partition Labels (LeetCode 763) | Solution with animations](https://www.youtube.com/watch?v=aUVEMnlcw4E) +- [@video@LeetCode 763. Partition Labels (Solution Explained)](https://www.youtube.com/watch?v=5NCjHqx2v-k) \ 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 index cf0dca6a58f8..e9efada5488a 100644 --- a/src/data/roadmaps/leetcode/content/permutations@-9-5g5Qyb3JiSwEfabmRD.md +++ b/src/data/roadmaps/leetcode/content/permutations@-9-5g5Qyb3JiSwEfabmRD.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Permutations](https://leetcode.com/problems/permutations/) +- [@video@Permutations (LeetCode 46) | Full solution with backtracking examples](https://www.youtube.com/watch?v=H232aocj7bQ) +- [@video@Permutations - Leetcode 46 - Recursive Backtracking (Python)](https://www.youtube.com/watch?v=gFm1lEfnzUQ) \ 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 index d568bffa8ef6..dcc51b8bcc78 100644 --- a/src/data/roadmaps/leetcode/content/powx-n@ea7dib41v61Vz--ewLcF4.md +++ b/src/data/roadmaps/leetcode/content/powx-n@ea7dib41v61Vz--ewLcF4.md @@ -1,3 +1,9 @@ # 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 +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/). + +Visit the following resources to learn more: + +- [@article@Pow(x, n)](https://leetcode.com/problems/powx-n/) +- [@video@POW(x,n) | Binary Exponentiation | Leetcode](https://www.youtube.com/watch?v=l0YC3876qxg) +- [@video@Pow(x, n) Python Solution - LeetCode #50](https://www.youtube.com/watch?v=bP4lhQP7_ao) \ 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 index 124cc86d0cdb..80ef271e4652 100644 --- a/src/data/roadmaps/leetcode/content/python@BZvNEZjCNuHPg5SkX90bt.md +++ b/src/data/roadmaps/leetcode/content/python@BZvNEZjCNuHPg5SkX90bt.md @@ -1,3 +1,7 @@ # 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 +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. + +Visit the following resources to learn more: + +- [@roadmap@Visit the Dedicated Python Roadmap](https://roadmap.sh/python) \ 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 index f1547d840900..a976d2b7e0ea 100644 --- a/src/data/roadmaps/leetcode/content/reconstruct-itinerary@Edk5ydpwut57XDc08QEgc.md +++ b/src/data/roadmaps/leetcode/content/reconstruct-itinerary@Edk5ydpwut57XDc08QEgc.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Reconstruct Itinerary](https://leetcode.com/problems/reconstruct-itinerary/) +- [@video@Reconstruct Itinerary | Leetcode #332](https://www.youtube.com/watch?v=WYqsg5dziaQ) +- [@video@Leetcode - Reconstruct Itinerary (Python)](https://www.youtube.com/watch?v=iHhNWam4BSM) \ 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 index 57ce0c4123a8..448c9cb113f8 100644 --- a/src/data/roadmaps/leetcode/content/regular-expression-matching@XTDdSFywX863IErL0rmc6.md +++ b/src/data/roadmaps/leetcode/content/regular-expression-matching@XTDdSFywX863IErL0rmc6.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Regular Expression Matching](https://leetcode.com/problems/regular-expression-matching/) +- [@video@Regular Expression Matching Python Solution - LeetCode #10](https://www.youtube.com/watch?v=ZNI_yXaGlxY) +- [@video@Regular Expression Matching | Brute Force | Optimal](https://www.youtube.com/watch?v=3vbBrl-LeDc) \ 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 index 5e2ad4a0d1c1..adc995589d6f 100644 --- a/src/data/roadmaps/leetcode/content/reorder-list@FYgKuhnZ20g6-v4UrQDJc.md +++ b/src/data/roadmaps/leetcode/content/reorder-list@FYgKuhnZ20g6-v4UrQDJc.md @@ -1,3 +1,9 @@ # 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 +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. This problem combines three sub-techniques (finding middle, reversing, merging) and teaches you to decompose complex pointer problems into simpler steps. + +Visit the following resources to learn more: + +- [@article@Reorder List](https://leetcode.com/problems/reorder-list/) +- [@video@LeetCode Reorder List Solution Explained - Java](https://www.youtube.com/watch?v=xRYPjDMSUFw) +- [@video@Reorder List (LeetCode 143) | Full Solution](https://www.youtube.com/watch?v=Pno7rUOZM-o) \ 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 index a8a22d8ae423..679dcd0704bf 100644 --- a/src/data/roadmaps/leetcode/content/replace-words@IINhLJ2evjsS_v2DH3AA1.md +++ b/src/data/roadmaps/leetcode/content/replace-words@IINhLJ2evjsS_v2DH3AA1.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Replace Words](https://leetcode.com/problems/replace-words/) +- [@video@Leetcode 648 Replace Words](https://www.youtube.com/watch?v=5liJnc8iNeY) +- [@video@✅ Replace Words - LeetCode 648 - Strings - Tries - Explained in Detail - Interview Solution](https://www.youtube.com/watch?v=HdQeNCwE2tU) \ 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 index 458dcc1ed914..58b28b3f0250 100644 --- a/src/data/roadmaps/leetcode/content/reverse-bits@KHR39YdCVeSGJtHrcLJyT.md +++ b/src/data/roadmaps/leetcode/content/reverse-bits@KHR39YdCVeSGJtHrcLJyT.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Reverse Bits](https://leetcode.com/problems/reverse-bits/) +- [@video@Reverse Bits - LeetCode 190 - Python](https://www.youtube.com/watch?v=PywybHkTtPo) +- [@video@Reverse Bits | Leetcode 190 | Easy](https://www.youtube.com/watch?v=-5z9dimxxmI) \ 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 index e23417d973f1..3daa7a0690ff 100644 --- a/src/data/roadmaps/leetcode/content/reverse-linked-list@0P0VTUhQxWj0BGygtuKYJ.md +++ b/src/data/roadmaps/leetcode/content/reverse-linked-list@0P0VTUhQxWj0BGygtuKYJ.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/) +- [@video@Reverse Linked List - Leetcode 206 - Linked Lists (Python)](https://www.youtube.com/watch?v=KRxeMng7fBU) +- [@video@LeetCode - Reverse Linked List Solution](https://www.youtube.com/watch?v=NhapasNIKuQ) \ 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 index ff38446b7dd0..fc6d50b804fb 100644 --- a/src/data/roadmaps/leetcode/content/rotate-image@P9U_DFbutAYwQGZjjf-oP.md +++ b/src/data/roadmaps/leetcode/content/rotate-image@P9U_DFbutAYwQGZjjf-oP.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Rotate Image](https://leetcode.com/problems/rotate-image/) +- [@video@Rotate Image (Leetcode 48) | Full solution](https://www.youtube.com/watch?v=Ux058jpRB9Y) +- [@video@Rotate Image - Leetcode 48 - Arrays & Strings (Python)](https://www.youtube.com/watch?v=-jhbxNJijyE) \ 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 index 101f2744f6bc..511c94910d94 100644 --- a/src/data/roadmaps/leetcode/content/ruby@XyRCXhZjQFcDNaUSNNQV-.md +++ b/src/data/roadmaps/leetcode/content/ruby@XyRCXhZjQFcDNaUSNNQV-.md @@ -1,3 +1,7 @@ # 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 +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. + +Visit the following resources to learn more: + +- [@roadmap@Visit the Dedicated Ruby Roadmap](https://roadmap.sh/ruby) \ 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 index a98c337d3dfe..a4d0366e3161 100644 --- a/src/data/roadmaps/leetcode/content/rust@9h1mz0xAUvPrnRm9VndJF.md +++ b/src/data/roadmaps/leetcode/content/rust@9h1mz0xAUvPrnRm9VndJF.md @@ -1,3 +1,7 @@ # 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 +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. + +Visit the following resources to learn more: + +- [@official@Visit the Dedicated Rust Roadmap](https://roadmap.sh/rust) \ 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 index 88bb4aef6f2f..1cd6f14b0e2e 100644 --- a/src/data/roadmaps/leetcode/content/scala@acgRMEuL4ZGGRHpZ7kXSo.md +++ b/src/data/roadmaps/leetcode/content/scala@acgRMEuL4ZGGRHpZ7kXSo.md @@ -1,3 +1,7 @@ # 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 +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. + +Visit the following resources to learn more: + +- [@roadmap@Visit the Dedicated Scala Roadmap](https://roadmap.sh/scala) \ 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 index 1135b73e42c8..2d10d6854212 100644 --- 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 @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/) +- [@video@LeetCode 33. Search in Rotated Sorted Array](https://www.youtube.com/watch?v=QdVrY3stDD4) +- [@video@Search in Rotated Sorted Array](https://www.youtube.com/watch?v=4Ik1nCLjwcI) \ 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 index 2ed85fa9a6d0..bab886f728ab 100644 --- 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 @@ -1,3 +1,8 @@ # 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 +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 following resources to learn more: + +- [@article@Serialize and Deserialize Binary Tree](https://leetcode.com/problems/serialize-and-deserialize-binary-tree/) +- [@video@Serialize and Deserialize a Binary Tree](https://www.youtube.com/watch?v=Q9DrSCqg1rw) \ 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 index 45accd6be899..46ed38b29380 100644 --- a/src/data/roadmaps/leetcode/content/set-matrix-zeroes@ScROycnqOk2U2GW-Ghy2W.md +++ b/src/data/roadmaps/leetcode/content/set-matrix-zeroes@ScROycnqOk2U2GW-Ghy2W.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Set Matrix Zeroes](https://leetcode.com/problems/set-matrix-zeroes/) +- [@video@Set Matrix Zeroes - LeetCode 73 - Python](https://www.youtube.com/watch?v=IJ24FVsgPFU) +- [@video@Set Matrix Zeroes (LeetCode 73) | Full solution](https://www.youtube.com/watch?v=dSxt3ZCbIqA) \ 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 index 6cd18ba91f78..80ee29756d9f 100644 --- a/src/data/roadmaps/leetcode/content/single-number@4UGevGjQBhbISeh_5bm_e.md +++ b/src/data/roadmaps/leetcode/content/single-number@4UGevGjQBhbISeh_5bm_e.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Single Number](https://leetcode.com/problems/single-number/) +- [@video@Single Number - LeetCode 136 - Python #leetcode](https://www.youtube.com/watch?v=JnM0SQGlLY4) +- [@video@Single Number - Leetcode 136 - Bit Manipulation (Python)](https://www.youtube.com/watch?v=mriHA5vEh0A) \ 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 index aa49762418be..d7dcf6f817b8 100644 --- a/src/data/roadmaps/leetcode/content/sliding-window-maximum@zIpM4hiGUSXwkokZFRzSB.md +++ b/src/data/roadmaps/leetcode/content/sliding-window-maximum@zIpM4hiGUSXwkokZFRzSB.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Sliding Window Maximum](https://leetcode.com/problems/sliding-window-maximum/) +- [@video@Sliding Window Maximum (LeetCode 239)](https://www.youtube.com/watch?v=WcTMo1SHV_s) +- [@video@Sliding Window Maximum: Efficient Solution](https://www.youtube.com/watch?v=5VjQD62gOYA) \ 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 index fba3f5c88670..ff39e764713c 100644 --- a/src/data/roadmaps/leetcode/content/sliding-window@1boDzMfojddbf1ZwzOvEV.md +++ b/src/data/roadmaps/leetcode/content/sliding-window@1boDzMfojddbf1ZwzOvEV.md @@ -1,3 +1,8 @@ -# Stage 5 — Sliding Window +# 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 +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. + +Visit the following resources to learn more: + +- [@article@Sliding Window Technique: A Comprehensive Guide](https://leetcode.com/discuss/post/3722472/sliding-window-technique-a-comprehensive-ix2k/) +- [@article@Sliding Window in 7 minutes | LeetCode Pattern](https://www.youtube.com/watch?v=y2d0VHdvfdc) \ 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 index 1c8277f877ee..601ed8788267 100644 --- a/src/data/roadmaps/leetcode/content/spiral-matrix@H6lLJWRhjRVq5ZqKEJ8bL.md +++ b/src/data/roadmaps/leetcode/content/spiral-matrix@H6lLJWRhjRVq5ZqKEJ8bL.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Spiral Matrix](https://leetcode.com/problems/spiral-matrix/) +- [@video@Spiral Matrix (LeetCode 54) | Full Solution](https://www.youtube.com/watch?v=aqVW8IuXUF0) +- [@video@Spiral Matrix - Leetcode 54 - Arrays & Strings (Python)](https://www.youtube.com/watch?v=fcn8qkRcFVM) \ 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 index 52ff8674a1d8..64fabd5c6667 100644 --- a/src/data/roadmaps/leetcode/content/stacks@Ovs61JkceGbWV3BfUo4Ra.md +++ b/src/data/roadmaps/leetcode/content/stacks@Ovs61JkceGbWV3BfUo4Ra.md @@ -1,3 +1,8 @@ -# Stage 3 — Stack +# Stacks -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 +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. + +Visit the following resources to learn more: + +- [@article@DSA Stacks](https://www.w3schools.com/dsa/dsa_data_stacks.php) +- [@video@wtf is “the stack” ?](https://www.youtube.com/watch?v=CRTR5ljBjPM) \ 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 index bd4ef26cc18c..7a1a8642ee4d 100644 --- a/src/data/roadmaps/leetcode/content/subsets@2AfJtRru4gll77Vl-6IJM.md +++ b/src/data/roadmaps/leetcode/content/subsets@2AfJtRru4gll77Vl-6IJM.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Subsets](https://leetcode.com/problems/subsets/) +- [@video@Subsets (LeetCode 78) | Full solution with backtracking examples](https://www.youtube.com/watch?v=3tpjp5h3M6Y) +- [@video@Subsets - Leetcode 78 - Recursive Backtracking (Python)](https://www.youtube.com/watch?v=UP3dOYJa05s) \ 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 index dfa51d4f98e2..8164c3b3aa05 100644 --- a/src/data/roadmaps/leetcode/content/substring-without-repetition@wnHn7ooWZSUfk3HahuyG6.md +++ b/src/data/roadmaps/leetcode/content/substring-without-repetition@wnHn7ooWZSUfk3HahuyG6.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) +- [@video@Longest Substring Without Repeating Characters](https://www.youtube.com/watch?v=FCbOzdHKW18) +- [@video@Longest Substring Without Repeating Characters](https://www.youtube.com/watch?v=V3lL9RaZKaA) \ 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 index c477dd3b75f8..aaf33204ae0d 100644 --- 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 @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Sum of Two Integers](https://leetcode.com/problems/sum-of-two-integers/) +- [@video@Sum of Two Integers - LeetCode 371 - Python](https://www.youtube.com/watch?v=MmIx_NrCkGI) +- [@video@Google Interview Question - Sum of Two Integers - LeetCode 371](https://www.youtube.com/watch?v=6vETcY7qfEo) \ 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 index 7f36c5bcb8bf..ce14767886e2 100644 --- 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 @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Swim in Rising Water](https://leetcode.com/problems/swim-in-rising-water/) +- [@video@Leetcode - Swim in Rising Water (Python)](https://www.youtube.com/watch?v=QJuzj-Gm-IM) +- [@video@Swim in Rising Water | Different Ways To Think](https://www.youtube.com/watch?v=9WYhuzn8hd8) \ 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 index 22e6aa7ba98e..2ffa91828bd7 100644 --- a/src/data/roadmaps/leetcode/content/task-scheduler@HLTc2xupm-CNM9rgzrcwS.md +++ b/src/data/roadmaps/leetcode/content/task-scheduler@HLTc2xupm-CNM9rgzrcwS.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Task Scheduler](https://leetcode.com/problems/task-scheduler/) +- [@video@LeetCode 621. Task Scheduler (Algorithm Explained)](https://www.youtube.com/watch?v=eGf-26OTI-A) +- [@video@Task Scheduler - LeetCode 621 - Python](https://www.youtube.com/watch?v=CHlCkJadQ7o) \ 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 index 146f76ff893e..dae832e6c752 100644 --- a/src/data/roadmaps/leetcode/content/top-k-frequent-elements@-RjNtskTl7CZYWUpQ6YPh.md +++ b/src/data/roadmaps/leetcode/content/top-k-frequent-elements@-RjNtskTl7CZYWUpQ6YPh.md @@ -1,3 +1,8 @@ # 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 +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 following resources to learn more: + +- [@article@Top K Frequent Elements - LeetCode](https://leetcode.com/problems/top-k-frequent-elements/description/) +- [@video@Top K Elements in 6 minutes](https://www.youtube.com/watch?v=6_v6OoxvMOE) \ 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 index f43036c20a7a..55de916b4356 100644 --- a/src/data/roadmaps/leetcode/content/trapping-rain-water@GuWseHiGMKbBqkYKrZNuT.md +++ b/src/data/roadmaps/leetcode/content/trapping-rain-water@GuWseHiGMKbBqkYKrZNuT.md @@ -1,3 +1,9 @@ # 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 +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 directions. + +Visit the following resources to learn more: + +- [@article@Trapping Rain Water - LeetCode](https://leetcode.com/problems/trapping-rain-water/description/) +- [@video@How to Solve Trapping Rainwater in 2 MINUTES](https://www.youtube.com/watch?v=Gu6Iu4q2sd8) +- [@video@Trapping Rain Water](https://www.youtube.com/watch?v=KFdHpOlz8hs) \ 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 index 35f050f17c54..b9f55450b4fe 100644 --- a/src/data/roadmaps/leetcode/content/trees@PQ31G4_7Y5K6D34hVRyRK.md +++ b/src/data/roadmaps/leetcode/content/trees@PQ31G4_7Y5K6D34hVRyRK.md @@ -1,3 +1,9 @@ -# Stage 7 — Trees +# 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 +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. + +Visit the following resources to learn more: + +- [@article@Trees DSA](https://www.w3schools.com/dsa/dsa_theory_trees.php) +- [@article@Trees](https://www.programiz.com/dsa/trees) +- [@video@Tree data structures in 2 minutes 🌳](https://www.youtube.com/watch?v=Etpc_-br5rI&t=1s) \ 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 index 03a0cb11f501..efdecf1596ba 100644 --- a/src/data/roadmaps/leetcode/content/tries@dmY-zE1Lql_HfTnhMfKMV.md +++ b/src/data/roadmaps/leetcode/content/tries@dmY-zE1Lql_HfTnhMfKMV.md @@ -1,3 +1,8 @@ -# Stage 10 — Tries +# 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 +A trie is a tree structure built from the characters of strings, where each path from the 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. + +Visit the following resources to learn more: + +- [@article@Trying to Understand Tries](https://medium.com/basecs/trying-to-understand-tries-3ec6bede0014) +- [@video@Data Structures: Tries](https://www.youtube.com/watch?v=zIjfhVPRZCg) \ 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 index a4b89c436f8d..4f70bec31697 100644 --- a/src/data/roadmaps/leetcode/content/two-pointers@NHv86YI2-MSH8BkfUsaEx.md +++ b/src/data/roadmaps/leetcode/content/two-pointers@NHv86YI2-MSH8BkfUsaEx.md @@ -1,3 +1,8 @@ -# Stage 2 — Two Pointers +# 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 +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. + +Visit the following resources to learn more: + +- [@article@Mastering Problem Solving: Two Pointers](https://medium.com/@elfrmkr98/mastering-problem-solving-two-pointers-technique-23dafb17e90b) +- [@video@Two Pointers in 7 minutes](https://www.youtube.com/watch?v=QzZ7nmouLTI) \ 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 index f685125a2c44..380c68f80ed8 100644 --- a/src/data/roadmaps/leetcode/content/two-sum-ii@vTpv8AliKFv0Sf13PmVCo.md +++ b/src/data/roadmaps/leetcode/content/two-sum-ii@vTpv8AliKFv0Sf13PmVCo.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Two Sum II - Input Array Is Sorted - LeetCode](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/description/) +- [@video@Two Sum II - Leetcode 167](https://www.youtube.com/watch?v=ciPrKYoOQkI) +- [@video@[Java] Leetcode 167. Two Sum II](https://www.youtube.com/watch?v=CWUnvUJ29zw) \ 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 07a1c52a063e..79f46746df5e 100644 --- a/src/data/roadmaps/leetcode/content/two-sum@XbfUbWaGtpcEGa31QyrXN.md +++ b/src/data/roadmaps/leetcode/content/two-sum@XbfUbWaGtpcEGa31QyrXN.md @@ -1,3 +1,8 @@ # Two Sum -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 +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 following resources to learn more: + +- [@article@Two Sum - LeetCode](https://leetcode.com/problems/two-sum/description/) +- [@video@Two Sum - Leetcode 1 - Hashmaps & Sets (Python)](https://www.youtube.com/watch?v=aRE7Nxb3Qfs) \ 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 index 1987d78820b9..ec65903b059c 100644 --- a/src/data/roadmaps/leetcode/content/unique-paths@xhEBSwgHsrCQolM9UvJ-c.md +++ b/src/data/roadmaps/leetcode/content/unique-paths@xhEBSwgHsrCQolM9UvJ-c.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Unique Paths](https://leetcode.com/problems/unique-paths/) +- [@video@Unique Paths - Leetcode 62 - Dynamic Programming (Python)](https://www.youtube.com/watch?v=3ZFvBlynmls) +- [@video@Unique Paths (LeetCode 62)](https://www.youtube.com/watch?v=Ee-rJmkwaTM) \ 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 index 770c3b0b8a39..113b38c0baf9 100644 --- a/src/data/roadmaps/leetcode/content/valid-anagram@iqR33GoIxK-CJdbatQqg3.md +++ b/src/data/roadmaps/leetcode/content/valid-anagram@iqR33GoIxK-CJdbatQqg3.md @@ -1,3 +1,8 @@ # 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 +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 following resources to learn more: + +- [@article@Valid Anagram - LeetCode](https://leetcode.com/problems/valid-anagram/description/) +- [@video@Valid Anagram | LeetCode problem 242 | Top 150 interview question series](https://backoffice.roadmap.sh/tree/leetcode) \ 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 index d4d6ae304704..69dbbb7f1002 100644 --- 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 @@ -1,3 +1,9 @@ # 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 +Given a string, determine if it reads the same forward 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 following resources to learn more: + +- [@article@Valid Palindrome - LeetCode](https://leetcode.com/problems/valid-palindrome/description/) +- [@video@Valid Palindrome - LeetCode 125 | Two Pointers](https://www.youtube.com/watch?v=pf5RT8Oi7rk) +- [@video@LeetCode Valid Palindrome](https://www.youtube.com/watch?v=rYyn9Vc-dBQ) \ 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 index d75ee3c45afe..1c56ab97b6fc 100644 --- a/src/data/roadmaps/leetcode/content/valid-parentheses@YNt85B--HBS2IKDFVLJpx.md +++ b/src/data/roadmaps/leetcode/content/valid-parentheses@YNt85B--HBS2IKDFVLJpx.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Valid Parentheses - LeetCode](https://leetcode.com/problems/valid-parentheses/description/) +- [@video@Valid Parentheses (LeetCode 20)](https://www.youtube.com/watch?v=TaWs8tIrnoA) +- [@video@Valid Parentheses - Leetcode 20 - Stacks (Python)](https://www.youtube.com/watch?v=7-_V-ufnF4c) \ 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 index 5777b4753bf4..4b62827e3050 100644 --- a/src/data/roadmaps/leetcode/content/what-are-coding-patterns@ScTtg57POE0kxlZFxYUCs.md +++ b/src/data/roadmaps/leetcode/content/what-are-coding-patterns@ScTtg57POE0kxlZFxYUCs.md @@ -1,3 +1,8 @@ # 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 +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. + +Visit the following resources to learn more: + +- [@article@Don’t Just LeetCode; Follow the Coding Patterns Instead](https://levelup.gitconnected.com/dont-just-leetcode-follow-the-coding-patterns-instead-4beb6a197fdb) +- [@video@Data Structure and Algorithm Patterns for LeetCode Interviews – Tutorial](https://www.youtube.com/watch?v=Z_c4byLrNBU) \ 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 index dc7609fd0617..cf86a82bcee1 100644 --- 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 @@ -1,3 +1,8 @@ # 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 +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. + +Visit the following resources to learn more: + +- [@official@LeetCode](https://leetcode.com/) +- [@article@What I Learned From LeetCode](https://tenmilesquare.com/resources/software-development/what-i-learned-from-leetcode/) \ 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 index ca75e35d0dd4..85b710c8f18e 100644 --- a/src/data/roadmaps/leetcode/content/word-break@1i59D4ME10oOkxthILaNP.md +++ b/src/data/roadmaps/leetcode/content/word-break@1i59D4ME10oOkxthILaNP.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Word Break](https://leetcode.com/problems/word-break/) +- [@video@Word Break (LeetCode 139)](https://www.youtube.com/watch?v=hK6Git1o42c) +- [@video@Word Break - LeetCode 139 - Python](https://www.youtube.com/watch?v=TK9pptFzH-A) \ 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 index 78a1f402a171..b8fb10ddc9c1 100644 --- a/src/data/roadmaps/leetcode/content/word-ladder@J8YZFOS2sVwILJWdUphIU.md +++ b/src/data/roadmaps/leetcode/content/word-ladder@J8YZFOS2sVwILJWdUphIU.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Word Ladder](https://leetcode.com/problems/word-ladder/) +- [@video@Word Ladder (LeetCode 127) | Interview Essential](https://www.youtube.com/watch?v=kFKcWYCUpBg) +- [@video@Word Ladder | Leetcode #127](https://www.youtube.com/watch?v=ZVJ3asMoZ18) \ 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 index 3a8585be4862..0b27a4d6e1b2 100644 --- a/src/data/roadmaps/leetcode/content/word-search-ii@46Y-wvaUJZwd32mRqrRix.md +++ b/src/data/roadmaps/leetcode/content/word-search-ii@46Y-wvaUJZwd32mRqrRix.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Word Search II](https://leetcode.com/problems/word-search-ii/) +- [@video@[Java] Leetcode 212. Word Search II [Backtracking #12]](https://www.youtube.com/watch?v=IryjR5DteW4) +- [@video@Word Search II | DFS + Map | DFS + TRIE | Leetcode #212](https://www.youtube.com/watch?v=EmvsBM7o-5k) \ 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 index cdfef4567172..e64c891f5f67 100644 --- a/src/data/roadmaps/leetcode/content/word-search@boJmdiyIgbV61MDKsB-k-.md +++ b/src/data/roadmaps/leetcode/content/word-search@boJmdiyIgbV61MDKsB-k-.md @@ -1,3 +1,9 @@ # 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 +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 following resources to learn more: + +- [@article@Word Search](https://leetcode.com/problems/word-search/) +- [@video@LeetCode Word Search Solution Explained - Java](https://www.youtube.com/watch?v=m9TrOL1ETxI) +- [@video@Word Search - Leetcode 79 - Recursive Backtracking (Python)](https://www.youtube.com/watch?v=Sn2DqF-S2h8) \ No newline at end of file