Files
leetcode/README.md
T

341 lines
35 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<p align="center">
<img alt="header" src="https://shieldcn.dev/header/gradient.svg?title=prdlk%2Fleetcode&amp;subtitle=My+Personal+LeetCode+Solutions&amp;logo=leetcode&amp;logoColor=eab308&amp;mode=dark" />
</p>
<p align="center">
<a href="https://x.com/basedprad"><img alt="follow" src="https://shieldcn.dev/x/follow/basedprad.svg" /></a>
<a href="https://lc.prad.nu"><img alt="badge" src="https://shieldcn.dev/badge/Read-Documentation.svg?logo=lu%3ABook" /></a>
<a href="https://lc.prad.nu/progress"><img alt="gate pass rate" src="https://srs-api.prdlk.workers.dev/badge/gate.svg" /></a>
</p>
<p align="center">
<sub>8-week interview-prep fight camp. Each phase is a milestone; each topic an issue; each problem a sub-issue.<br>
New topic MonFri, gate on Saturday, Sunday off — every solve comes back at <strong>+3</strong> and <strong>+7</strong> days,
the two windows that keep the rest day clear (a Thursday solve's +3 slides to Monday).<br>
Charts are live from the SRS Worker, never committed: pushing a solution or tapping the daily digest moves them within ~5 min.</sub>
</p>
<table align="center">
<tr>
<td colspan="2" align="center"><img alt="phase progress" width="100%" src="https://srs-api.prdlk.workers.dev/chart/progress.svg" /></td>
</tr>
<tr>
<td align="center" width="53%"><img alt="SRS ladder — new / +3 / +7 / retired" width="100%" src="https://srs-api.prdlk.workers.dev/chart/ladder.svg" /></td>
<td align="center" width="47%"><img alt="attempt heatmap" width="100%" src="https://srs-api.prdlk.workers.dev/chart/heatmap.svg" /></td>
</tr>
</table>
## Phase I — Linear Structures · Weeks 12
<table>
<thead>
<tr>
<th align="left">Topic</th>
<th align="center">Set</th>
<th align="center">LC&nbsp;#</th>
<th align="left">Problem</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="9"><a href="https://github.com/prdlk/leetcode/issues/3"><strong>1. Hash-Based Lookup</strong></a><br><sub>Wk 1 · Mon Aug 17</sub><br><sub>builds on nothing</sub></td>
<td align="center"><code>A</code></td><td align="center">217</td><td><a href="https://leetcode.com/problems/contains-duplicate/">Contains Duplicate</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">242</td><td><a href="https://leetcode.com/problems/valid-anagram/">Valid Anagram</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">1</td><td><a href="https://leetcode.com/problems/two-sum/">Two Sum</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">49</td><td><a href="https://leetcode.com/problems/group-anagrams/">Group Anagrams</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">347</td><td><a href="https://leetcode.com/problems/top-k-frequent-elements/">Top K Frequent Elements</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">383</td><td><a href="https://leetcode.com/problems/ransom-note/">Ransom Note</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">205</td><td><a href="https://leetcode.com/problems/isomorphic-strings/">Isomorphic Strings</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">128</td><td><a href="https://leetcode.com/problems/longest-consecutive-sequence/">Longest Consecutive Sequence</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">290</td><td><a href="https://leetcode.com/problems/word-pattern/">Word Pattern</a></td></tr>
<tr>
<td rowspan="5"><a href="https://github.com/prdlk/leetcode/issues/4"><strong>2. Prefix Sum</strong></a><br><sub>Wk 1 · Tue Aug 18</sub><br><sub>builds on 1</sub></td>
<td align="center"><code>A</code></td><td align="center">303</td><td><a href="https://leetcode.com/problems/range-sum-query-immutable/">Range Sum Query</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">238</td><td><a href="https://leetcode.com/problems/product-of-array-except-self/">Product of Array Except Self</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">560</td><td><a href="https://leetcode.com/problems/subarray-sum-equals-k/">Subarray Sum Equals K</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">525</td><td><a href="https://leetcode.com/problems/contiguous-array/">Contiguous Array</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">974</td><td><a href="https://leetcode.com/problems/subarray-sums-divisible-by-k/">Subarray Sums Divisible by K</a></td></tr>
<tr>
<td rowspan="9"><a href="https://github.com/prdlk/leetcode/issues/5"><strong>3. Two Pointers</strong></a><br><sub>Wk 2 · Mon Aug 24</sub><br><sub>builds on ordered iteration</sub></td>
<td align="center"><code>A</code></td><td align="center">125</td><td><a href="https://leetcode.com/problems/valid-palindrome/">Valid Palindrome</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">167</td><td><a href="https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/">Two Sum II</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">15</td><td><a href="https://leetcode.com/problems/3sum/">3Sum</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">11</td><td><a href="https://leetcode.com/problems/container-with-most-water/">Container With Most Water</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">42</td><td><a href="https://leetcode.com/problems/trapping-rain-water/">Trapping Rain Water</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">392</td><td><a href="https://leetcode.com/problems/is-subsequence/">Is Subsequence</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">977</td><td><a href="https://leetcode.com/problems/squares-of-a-sorted-array/">Squares of a Sorted Array</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">189</td><td><a href="https://leetcode.com/problems/rotate-array/">Rotate Array</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">80</td><td><a href="https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/">Remove Duplicates II</a></td></tr>
<tr>
<td rowspan="8"><a href="https://github.com/prdlk/leetcode/issues/6"><strong>4. Sliding Window</strong></a><br><sub>Wk 2 · Tue Aug 25</sub><br><sub>builds on 3</sub></td>
<td align="center"><code>A</code></td><td align="center">121</td><td><a href="https://leetcode.com/problems/best-time-to-buy-and-sell-stock/">Best Time to Buy and Sell Stock</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">3</td><td><a href="https://leetcode.com/problems/longest-substring-without-repeating-characters/">Longest Substring Without Repeating Characters</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">424</td><td><a href="https://leetcode.com/problems/longest-repeating-character-replacement/">Longest Repeating Character Replacement</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">567</td><td><a href="https://leetcode.com/problems/permutation-in-string/">Permutation in String</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">76</td><td><a href="https://leetcode.com/problems/minimum-window-substring/">Minimum Window Substring</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">209</td><td><a href="https://leetcode.com/problems/minimum-size-subarray-sum/">Minimum Size Subarray Sum</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">1004</td><td><a href="https://leetcode.com/problems/max-consecutive-ones-iii/">Max Consecutive Ones III</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">643</td><td><a href="https://leetcode.com/problems/maximum-average-subarray-i/">Maximum Average Subarray</a></td></tr>
<tr>
<td rowspan="9"><a href="https://github.com/prdlk/leetcode/issues/7"><strong>5. Binary Search</strong></a><br><sub>Wk 2 · Wed Aug 26</sub><br><sub>builds on ordered / monotonic invariants</sub></td>
<td align="center"><code>A</code></td><td align="center">704</td><td><a href="https://leetcode.com/problems/binary-search/">Binary Search</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">74</td><td><a href="https://leetcode.com/problems/search-a-2d-matrix/">Search a 2D Matrix</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">875</td><td><a href="https://leetcode.com/problems/koko-eating-bananas/">Koko Eating Bananas</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">33</td><td><a href="https://leetcode.com/problems/search-in-rotated-sorted-array/">Search in Rotated Sorted Array</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">153</td><td><a href="https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/">Find Minimum in Rotated Sorted Array</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">35</td><td><a href="https://leetcode.com/problems/search-insert-position/">Search Insert Position</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">162</td><td><a href="https://leetcode.com/problems/find-peak-element/">Find Peak Element</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">34</td><td><a href="https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/">First &amp; Last Position</a></td></tr>
<tr><td align="center"><code>B</code> ⭐</td><td align="center">4</td><td><a href="https://leetcode.com/problems/median-of-two-sorted-arrays/">Median of Two Sorted Arrays</a></td></tr>
<tr>
<td rowspan="5"><a href="https://github.com/prdlk/leetcode/issues/8"><strong>6. Stack</strong></a><br><sub>Wk 2 · Thu Aug 27</sub><br><sub>independent primitive</sub></td>
<td align="center"><code>A</code></td><td align="center">20</td><td><a href="https://leetcode.com/problems/valid-parentheses/">Valid Parentheses</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">155</td><td><a href="https://leetcode.com/problems/min-stack/">Min Stack</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">150</td><td><a href="https://leetcode.com/problems/evaluate-reverse-polish-notation/">Evaluate Reverse Polish Notation</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">71</td><td><a href="https://leetcode.com/problems/simplify-path/">Simplify Path</a></td></tr>
<tr><td align="center"><code>B</code> ⭐</td><td align="center">224</td><td><a href="https://leetcode.com/problems/basic-calculator/">Basic Calculator</a></td></tr>
<tr>
<td rowspan="5"><a href="https://github.com/prdlk/leetcode/issues/9"><strong>7. Monotonic Stack</strong></a><br><sub>Wk 2 · Fri Aug 28</sub><br><sub>builds on 6</sub></td>
<td align="center"><code>A</code></td><td align="center">739</td><td><a href="https://leetcode.com/problems/daily-temperatures/">Daily Temperatures</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">853</td><td><a href="https://leetcode.com/problems/car-fleet/">Car Fleet</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">496</td><td><a href="https://leetcode.com/problems/next-greater-element-i/">Next Greater Element I</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">901</td><td><a href="https://leetcode.com/problems/online-stock-span/">Online Stock Span</a></td></tr>
<tr><td align="center"><code>B</code> ⭐</td><td align="center">84</td><td><a href="https://leetcode.com/problems/largest-rectangle-in-histogram/">Largest Rectangle in Histogram</a></td></tr>
</tbody>
</table>
## Phase II — Nodal &amp; Grid Structures · Week 3
<table>
<thead>
<tr>
<th align="left">Topic</th>
<th align="center">Set</th>
<th align="center">LC&nbsp;#</th>
<th align="left">Problem</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="10"><a href="https://github.com/prdlk/leetcode/issues/10"><strong>8. Linked List</strong></a><br><sub>Wk 3 · Mon Aug 31</sub><br><sub>independent primitive</sub></td>
<td align="center"><code>A</code></td><td align="center">206</td><td><a href="https://leetcode.com/problems/reverse-linked-list/">Reverse Linked List</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">21</td><td><a href="https://leetcode.com/problems/merge-two-sorted-lists/">Merge Two Sorted Lists</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">141</td><td><a href="https://leetcode.com/problems/linked-list-cycle/">Linked List Cycle</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">19</td><td><a href="https://leetcode.com/problems/remove-nth-node-from-end-of-list/">Remove Nth Node From End</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">143</td><td><a href="https://leetcode.com/problems/reorder-list/">Reorder List</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">876</td><td><a href="https://leetcode.com/problems/middle-of-the-linked-list/">Middle of the Linked List</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">92</td><td><a href="https://leetcode.com/problems/reverse-linked-list-ii/">Reverse Linked List II</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">82</td><td><a href="https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/">Remove Duplicates from Sorted List II</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">61</td><td><a href="https://leetcode.com/problems/rotate-list/">Rotate List</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">86</td><td><a href="https://leetcode.com/problems/partition-list/">Partition List</a></td></tr>
<tr>
<td rowspan="4"><a href="https://github.com/prdlk/leetcode/issues/11"><strong>9. Hybrid Structures</strong></a><br><sub>Wk 3 · Tue Sep 1</sub><br><sub>builds on 1 + 8</sub></td>
<td align="center"><code>A</code></td><td align="center">146</td><td><a href="https://leetcode.com/problems/lru-cache/">LRU Cache</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">2</td><td><a href="https://leetcode.com/problems/add-two-numbers/">Add Two Numbers</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">138</td><td><a href="https://leetcode.com/problems/copy-list-with-random-pointer/">Copy List with Random Pointer</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">380</td><td><a href="https://leetcode.com/problems/insert-delete-getrandom-o1/">Insert Delete GetRandom O(1)</a></td></tr>
<tr>
<td rowspan="5"><a href="https://github.com/prdlk/leetcode/issues/12"><strong>10. Matrix Index Math</strong></a><br><sub>Wk 3 · Wed Sep 2</sub><br><sub>builds on 3 — NOT graph traversal</sub></td>
<td align="center"><code>A</code></td><td align="center">48</td><td><a href="https://leetcode.com/problems/rotate-image/">Rotate Image</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">54</td><td><a href="https://leetcode.com/problems/spiral-matrix/">Spiral Matrix</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">73</td><td><a href="https://leetcode.com/problems/set-matrix-zeroes/">Set Matrix Zeroes</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">36</td><td><a href="https://leetcode.com/problems/valid-sudoku/">Valid Sudoku</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">289</td><td><a href="https://leetcode.com/problems/game-of-life/">Game of Life</a></td></tr>
</tbody>
</table>
## Phase III — Hierarchical Structures · Weeks 34
<table>
<thead>
<tr>
<th align="left">Topic</th>
<th align="center">Set</th>
<th align="center">LC&nbsp;#</th>
<th align="left">Problem</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="10"><a href="https://github.com/prdlk/leetcode/issues/13"><strong>11. Tree DFS</strong></a><br><sub>Wk 3 · Thu Sep 3</sub><br><sub>builds on recursion</sub></td>
<td align="center"><code>A</code></td><td align="center">226</td><td><a href="https://leetcode.com/problems/invert-binary-tree/">Invert Binary Tree</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">104</td><td><a href="https://leetcode.com/problems/maximum-depth-of-binary-tree/">Maximum Depth of Binary Tree</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">100</td><td><a href="https://leetcode.com/problems/same-tree/">Same Tree</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">572</td><td><a href="https://leetcode.com/problems/subtree-of-another-tree/">Subtree of Another Tree</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">236</td><td><a href="https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/">Lowest Common Ancestor</a></td></tr>
<tr><td align="center"><code>A</code> ⭐</td><td align="center">124</td><td><a href="https://leetcode.com/problems/binary-tree-maximum-path-sum/">Binary Tree Maximum Path Sum</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">101</td><td><a href="https://leetcode.com/problems/symmetric-tree/">Symmetric Tree</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">112</td><td><a href="https://leetcode.com/problems/path-sum/">Path Sum</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">129</td><td><a href="https://leetcode.com/problems/sum-root-to-leaf-numbers/">Sum Root to Leaf Numbers</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">543</td><td><a href="https://leetcode.com/problems/diameter-of-binary-tree/">Diameter of Binary Tree</a></td></tr>
<tr>
<td rowspan="5"><a href="https://github.com/prdlk/leetcode/issues/14"><strong>12. Tree BFS</strong></a><br><sub>Wk 3 · Fri Sep 4</sub><br><sub>builds on 6's sibling (queue) + 11</sub></td>
<td align="center"><code>A</code></td><td align="center">102</td><td><a href="https://leetcode.com/problems/binary-tree-level-order-traversal/">Level Order Traversal</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">199</td><td><a href="https://leetcode.com/problems/binary-tree-right-side-view/">Right Side View</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">1448</td><td><a href="https://leetcode.com/problems/count-good-nodes-in-binary-tree/">Count Good Nodes</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">103</td><td><a href="https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/">Zigzag Level Order</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">637</td><td><a href="https://leetcode.com/problems/average-of-levels-in-binary-tree/">Average of Levels</a></td></tr>
<tr>
<td rowspan="7"><a href="https://github.com/prdlk/leetcode/issues/15"><strong>13. Binary Search Tree</strong></a><br><sub>Wk 4 · Mon Sep 7</sub><br><sub>builds on 5 + 11</sub></td>
<td align="center"><code>A</code></td><td align="center">98</td><td><a href="https://leetcode.com/problems/validate-binary-search-tree/">Validate BST</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">230</td><td><a href="https://leetcode.com/problems/kth-smallest-element-in-a-bst/">Kth Smallest in BST</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">235</td><td><a href="https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/">LCA of BST</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">105</td><td><a href="https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/">Build from Preorder + Inorder</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">530</td><td><a href="https://leetcode.com/problems/minimum-absolute-difference-in-bst/">Minimum Absolute Difference</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">173</td><td><a href="https://leetcode.com/problems/binary-search-tree-iterator/">BST Iterator</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">108</td><td><a href="https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/">Sorted Array to BST</a></td></tr>
<tr>
<td rowspan="9"><a href="https://github.com/prdlk/leetcode/issues/16"><strong>14. Heap / Priority Queue</strong></a><br><sub>Wk 4 · Tue Sep 8</sub><br><sub>implicit tree over array</sub></td>
<td align="center"><code>A</code></td><td align="center">215</td><td><a href="https://leetcode.com/problems/kth-largest-element-in-an-array/">Kth Largest in Array</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">703</td><td><a href="https://leetcode.com/problems/kth-largest-element-in-a-stream/">Kth Largest in Stream</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">973</td><td><a href="https://leetcode.com/problems/k-closest-points-to-origin/">K Closest Points</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">621</td><td><a href="https://leetcode.com/problems/task-scheduler/">Task Scheduler</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">23</td><td><a href="https://leetcode.com/problems/merge-k-sorted-lists/">Merge K Sorted Lists</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">1046</td><td><a href="https://leetcode.com/problems/last-stone-weight/">Last Stone Weight</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">373</td><td><a href="https://leetcode.com/problems/find-k-pairs-with-smallest-sums/">K Pairs with Smallest Sums</a></td></tr>
<tr><td align="center"><code>B</code> ⭐</td><td align="center">295</td><td><a href="https://leetcode.com/problems/find-median-from-data-stream/">Find Median from Data Stream</a></td></tr>
<tr><td align="center"><code>B</code> ⭐</td><td align="center">502</td><td><a href="https://leetcode.com/problems/ipo/">IPO</a></td></tr>
<tr>
<td rowspan="3"><a href="https://github.com/prdlk/leetcode/issues/17"><strong>15. Trie</strong></a><br><sub>Wk 4 · Wed Sep 9</sub><br><sub>builds on 11</sub></td>
<td align="center"><code>A</code></td><td align="center">208</td><td><a href="https://leetcode.com/problems/implement-trie-prefix-tree/">Implement Trie</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">211</td><td><a href="https://leetcode.com/problems/design-add-and-search-words-data-structure/">Add &amp; Search Words</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">212</td><td><a href="https://leetcode.com/problems/word-search-ii/">Word Search II</a> <sub>(needs topic 20 — schedule after)</sub></td></tr>
</tbody>
</table>
## Phase IV — Relational Structures · Weeks 45
<table>
<thead>
<tr>
<th align="left">Topic</th>
<th align="center">Set</th>
<th align="center">LC&nbsp;#</th>
<th align="left">Problem</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="7"><a href="https://github.com/prdlk/leetcode/issues/18"><strong>16. Graph DFS</strong></a><br><sub>Wk 4 · Thu Sep 10</sub><br><sub>builds on 11 + visited set</sub></td>
<td align="center"><code>A</code></td><td align="center">200</td><td><a href="https://leetcode.com/problems/number-of-islands/">Number of Islands</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">695</td><td><a href="https://leetcode.com/problems/max-area-of-island/">Max Area of Island</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">133</td><td><a href="https://leetcode.com/problems/clone-graph/">Clone Graph</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">417</td><td><a href="https://leetcode.com/problems/pacific-atlantic-water-flow/">Pacific Atlantic Water Flow</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">130</td><td><a href="https://leetcode.com/problems/surrounded-regions/">Surrounded Regions</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">399</td><td><a href="https://leetcode.com/problems/evaluate-division/">Evaluate Division</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">261</td><td><a href="https://leetcode.com/problems/graph-valid-tree/">Graph Valid Tree</a></td></tr>
<tr>
<td rowspan="5"><a href="https://github.com/prdlk/leetcode/issues/19"><strong>17. Graph BFS</strong></a><br><sub>Wk 4 · Fri Sep 11</sub><br><sub>builds on 12 + visited set — shortest path unweighted</sub></td>
<td align="center"><code>A</code></td><td align="center">994</td><td><a href="https://leetcode.com/problems/rotting-oranges/">Rotting Oranges</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">127</td><td><a href="https://leetcode.com/problems/word-ladder/">Word Ladder</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">909</td><td><a href="https://leetcode.com/problems/snakes-and-ladders/">Snakes and Ladders</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">433</td><td><a href="https://leetcode.com/problems/minimum-genetic-mutation/">Minimum Genetic Mutation</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">286</td><td><a href="https://leetcode.com/problems/walls-and-gates/">Walls and Gates</a></td></tr>
<tr>
<td rowspan="4"><a href="https://github.com/prdlk/leetcode/issues/20"><strong>18. Topological Sort</strong></a><br><sub>Wk 5 · Mon Sep 14</sub><br><sub>builds on 16</sub></td>
<td align="center"><code>A</code></td><td align="center">207</td><td><a href="https://leetcode.com/problems/course-schedule/">Course Schedule</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">210</td><td><a href="https://leetcode.com/problems/course-schedule-ii/">Course Schedule II</a></td></tr>
<tr><td align="center"><code>B</code> ⭐</td><td align="center">269</td><td><a href="https://leetcode.com/problems/alien-dictionary/">Alien Dictionary</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">1462</td><td><a href="https://leetcode.com/problems/course-schedule-iv/">Course Schedule IV</a></td></tr>
<tr>
<td rowspan="4"><a href="https://github.com/prdlk/leetcode/issues/21"><strong>19. Union-Find</strong></a><br><sub>Wk 5 · Tue Sep 15</sub><br><sub>builds on 16's problem class</sub></td>
<td align="center"><code>A</code></td><td align="center">684</td><td><a href="https://leetcode.com/problems/redundant-connection/">Redundant Connection</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">323</td><td><a href="https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/">Number of Connected Components</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">128</td><td><a href="https://leetcode.com/problems/longest-consecutive-sequence/">Longest Consecutive (union-find variant)</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">721</td><td><a href="https://leetcode.com/problems/accounts-merge/">Accounts Merge</a></td></tr>
</tbody>
</table>
## Phase V — Decision-Space Exploration · Weeks 56
<table>
<thead>
<tr>
<th align="left">Topic</th>
<th align="center">Set</th>
<th align="center">LC&nbsp;#</th>
<th align="left">Problem</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="8"><a href="https://github.com/prdlk/leetcode/issues/22"><strong>20. Backtracking</strong></a><br><sub>Wk 5 · Wed Sep 16</sub><br><sub>builds on 16 — then unlock LC 212 from topic 15</sub></td>
<td align="center"><code>A</code></td><td align="center">78</td><td><a href="https://leetcode.com/problems/subsets/">Subsets</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">39</td><td><a href="https://leetcode.com/problems/combination-sum/">Combination Sum</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">46</td><td><a href="https://leetcode.com/problems/permutations/">Permutations</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">79</td><td><a href="https://leetcode.com/problems/word-search/">Word Search</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">17</td><td><a href="https://leetcode.com/problems/letter-combinations-of-a-phone-number/">Letter Combinations</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">77</td><td><a href="https://leetcode.com/problems/combinations/">Combinations</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">22</td><td><a href="https://leetcode.com/problems/generate-parentheses/">Generate Parentheses</a></td></tr>
<tr><td align="center"><code>B</code> ⭐</td><td align="center">52</td><td><a href="https://leetcode.com/problems/n-queens-ii/">N-Queens II</a></td></tr>
<tr>
<td rowspan="9"><a href="https://github.com/prdlk/leetcode/issues/23"><strong>21. 1-D Dynamic Programming</strong></a><br><sub>Wk 5 · Thu Sep 17</sub><br><sub>builds on 20</sub></td>
<td align="center"><code>A</code></td><td align="center">70</td><td><a href="https://leetcode.com/problems/climbing-stairs/">Climbing Stairs</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">746</td><td><a href="https://leetcode.com/problems/min-cost-climbing-stairs/">Min Cost Climbing Stairs</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">198</td><td><a href="https://leetcode.com/problems/house-robber/">House Robber</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">213</td><td><a href="https://leetcode.com/problems/house-robber-ii/">House Robber II</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">322</td><td><a href="https://leetcode.com/problems/coin-change/">Coin Change</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">300</td><td><a href="https://leetcode.com/problems/longest-increasing-subsequence/">Longest Increasing Subsequence</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">139</td><td><a href="https://leetcode.com/problems/word-break/">Word Break</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">91</td><td><a href="https://leetcode.com/problems/decode-ways/">Decode Ways</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">647</td><td><a href="https://leetcode.com/problems/palindromic-substrings/">Palindromic Substrings</a></td></tr>
<tr>
<td rowspan="8"><a href="https://github.com/prdlk/leetcode/issues/24"><strong>22. Multi-D / Grid DP</strong></a><br><sub>Wk 5 · Fri Sep 18</sub><br><sub>builds on 21</sub></td>
<td align="center"><code>A</code></td><td align="center">62</td><td><a href="https://leetcode.com/problems/unique-paths/">Unique Paths</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">64</td><td><a href="https://leetcode.com/problems/minimum-path-sum/">Minimum Path Sum</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">1143</td><td><a href="https://leetcode.com/problems/longest-common-subsequence/">Longest Common Subsequence</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">120</td><td><a href="https://leetcode.com/problems/triangle/">Triangle</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">63</td><td><a href="https://leetcode.com/problems/unique-paths-ii/">Unique Paths II</a></td></tr>
<tr><td align="center"><code>B</code> ⭐</td><td align="center">72</td><td><a href="https://leetcode.com/problems/edit-distance/">Edit Distance</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">221</td><td><a href="https://leetcode.com/problems/maximal-square/">Maximal Square</a></td></tr>
<tr><td align="center"><code>B</code> ⭐</td><td align="center">97</td><td><a href="https://leetcode.com/problems/interleaving-string/">Interleaving String</a></td></tr>
<tr>
<td rowspan="7"><a href="https://github.com/prdlk/leetcode/issues/25"><strong>23. Greedy</strong></a><br><sub>Wk 6 · Mon Sep 21</sub><br><sub>builds on 21 — includes Kadane's</sub></td>
<td align="center"><code>A</code></td><td align="center">53</td><td><a href="https://leetcode.com/problems/maximum-subarray/">Maximum Subarray</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">55</td><td><a href="https://leetcode.com/problems/jump-game/">Jump Game</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">45</td><td><a href="https://leetcode.com/problems/jump-game-ii/">Jump Game II</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">134</td><td><a href="https://leetcode.com/problems/gas-station/">Gas Station</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">122</td><td><a href="https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/">Best Time to Buy and Sell Stock II</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">918</td><td><a href="https://leetcode.com/problems/maximum-sum-circular-subarray/">Maximum Sum Circular Subarray</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">763</td><td><a href="https://leetcode.com/problems/partition-labels/">Partition Labels</a></td></tr>
<tr>
<td rowspan="7"><a href="https://github.com/prdlk/leetcode/issues/26"><strong>24. Intervals</strong></a><br><sub>Wk 6 · Tue Sep 22</sub><br><sub>builds on 23</sub></td>
<td align="center"><code>A</code></td><td align="center">57</td><td><a href="https://leetcode.com/problems/insert-interval/">Insert Interval</a></td>
</tr>
<tr><td align="center"><code>A</code></td><td align="center">56</td><td><a href="https://leetcode.com/problems/merge-intervals/">Merge Intervals</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">435</td><td><a href="https://leetcode.com/problems/non-overlapping-intervals/">Non-Overlapping Intervals</a></td></tr>
<tr><td align="center"><code>A</code></td><td align="center">253</td><td><a href="https://leetcode.com/problems/meeting-rooms-ii/">Meeting Rooms II</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">228</td><td><a href="https://leetcode.com/problems/summary-ranges/">Summary Ranges</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">452</td><td><a href="https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/">Minimum Arrows to Burst Balloons</a></td></tr>
<tr><td align="center"><code>B</code></td><td align="center">252</td><td><a href="https://leetcode.com/problems/meeting-rooms/">Meeting Rooms I</a></td></tr>
</tbody>
</table>