An open API service indexing awesome lists of open source software.

https://github.com/llancelot/leetcode

✍️ My LeetCode solutions, ideas and templates sharing. (我的LeetCode题解,思路以及各专题的解题模板分享。分专题归纳,见tag)
https://github.com/llancelot/leetcode

data-structures-and-algorithms interview-questions leetcode leetcode-solutions top-100-liked-questions top-interview-questions

Last synced: 5 months ago
JSON representation

✍️ My LeetCode solutions, ideas and templates sharing. (我的LeetCode题解,思路以及各专题的解题模板分享。分专题归纳,见tag)

Awesome Lists containing this project

README

        

# LeetCode
> 👉 2020 ~ 2022 两周年纪念!已达成 1000+ LeetCode题 & LeetCode Contest World Rating 前 10% 小成就。
>
> 🎉 目前已拿到多家互联网后端/国企/银行软开的21届offer,笔试及面试手撕环节 AC 率 95%。
>
> 希望能帮助到还在准备北美SDE、国内秋招&春招技术开发岗的各位,欢迎大家pull request一起完善!
>
> 👉 有需要 LeetCode 会员账号、或需要解锁查看内容的、有问题都欢迎私信我,我的会员2022年11月到期。

我的LeetCode刷题、思路和代码总结,以及常见算法模板。欢迎在仓库内搜索题解(since 2020, 目前工作繁忙,更新较慢).

欢迎各位star!便于日常学习/面试/笔试前复习,重在积累和**思路**,因为题目是做不完!

## 刷题方法

- 初期:题解标题下有原题链接,先自我思考5-10分钟,没有思路的话,立即“抄答案”,备考前期不要贪题量,每周保证每个 Tag 背熟 3 ~ 5 个 Medium 难度的经典题。
- **背熟!!**:算法模板代码👆([二分查找](https://github.com/LLancelot/LeetCode/blob/master/%E7%AE%97%E6%B3%95%E6%A8%A1%E6%9D%BF%E4%BB%A3%E7%A0%81/%E4%BA%8C%E5%88%86%E6%9F%A5%E6%89%BE.md)、[单链表](https://github.com/LLancelot/LeetCode/blob/master/%E7%AE%97%E6%B3%95%E6%A8%A1%E6%9D%BF%E4%BB%A3%E7%A0%81/%E5%8D%95%E9%93%BE%E8%A1%A8-%E6%95%B0%E7%BB%84%E5%86%99%E6%B3%95.md)、堆排序、[归并排序](https://github.com/LLancelot/LeetCode/blob/master/%E7%AE%97%E6%B3%95%E6%A8%A1%E6%9D%BF%E4%BB%A3%E7%A0%81/%E5%BD%92%E5%B9%B6%E6%8E%92%E5%BA%8F.java)、[快速排序](https://github.com/LLancelot/LeetCode/blob/master/%E7%AE%97%E6%B3%95%E6%A8%A1%E6%9D%BF%E4%BB%A3%E7%A0%81/%E5%BF%AB%E9%80%9F%E6%8E%92%E5%BA%8F.java)、[并查集](https://github.com/LLancelot/LeetCode/blob/master/%E7%AE%97%E6%B3%95%E6%A8%A1%E6%9D%BF%E4%BB%A3%E7%A0%81/%E5%B9%B6%E6%9F%A5%E9%9B%86.java)、[Trie 前缀树](https://github.com/LLancelot/LeetCode/blob/master/%E7%AE%97%E6%B3%95%E6%A8%A1%E6%9D%BF%E4%BB%A3%E7%A0%81/Trie%20%E5%89%8D%E7%BC%80%E6%A0%91.md)等)
- **经典模板题!**:Tag 分类👇,以及:
- 各种[双指针](https://github.com/LLancelot/LeetCode#two-pointers)问题、栈(Stack/深搜,题号232, 150, 224, 20, 1472, 1249)、队列(Queue/宽搜/二叉树层序遍历,225, 346, 1429, 54)、堆(Heap/Priority Queue/前K最值问题,347, 23, 692, 895, 295, 1438(Google原题))
- [84. 直方图最大矩形](https://github.com/LLancelot/LeetCode/blob/master/%E7%AE%97%E6%B3%95%E6%A8%A1%E6%9D%BF%E4%BB%A3%E7%A0%81/%E6%9C%80%E5%A4%A7%E7%9F%A9%E5%BD%A2.java)
- [53. 最大连续子数组的和](https://github.com/LLancelot/LeetCode/blob/master/%E7%AE%97%E6%B3%95%E6%A8%A1%E6%9D%BF%E4%BB%A3%E7%A0%81/%E6%9C%80%E5%A4%A7%E8%BF%9E%E7%BB%AD%E5%AD%90%E6%95%B0%E7%BB%84%E7%9A%84%E5%92%8C.md)、[300. 最长上升子序列 LIS](https://github.com/LLancelot/LeetCode/issues/14)、[最长上升公共子序列](https://github.com/LLancelot/LeetCode/blob/master/%E7%AE%97%E6%B3%95%E6%A8%A1%E6%9D%BF%E4%BB%A3%E7%A0%81/%E6%9C%80%E9%95%BF%E4%B8%8A%E5%8D%87%E5%85%AC%E5%85%B1%E5%AD%90%E5%BA%8F%E5%88%97.md)、[最长连续不重复的子序列](https://github.com/LLancelot/LeetCode/blob/master/%E7%AE%97%E6%B3%95%E6%A8%A1%E6%9D%BF%E4%BB%A3%E7%A0%81/%E6%9C%80%E9%95%BF%E8%BF%9E%E7%BB%AD%E4%B8%8D%E9%87%8D%E5%A4%8D%E7%9A%84%E5%AD%90%E5%BA%8F%E5%88%97.md)
- [股票买卖系列](https://github.com/LLancelot/LeetCode/blob/master/%E7%AE%97%E6%B3%95%E6%A8%A1%E6%9D%BF%E4%BB%A3%E7%A0%81/%E8%82%A1%E7%A5%A8%E4%B9%B0%E5%8D%96%E6%B1%87%E6%80%BB.md)
- 经典DFS/BFS搜索问题:0/1二维矩阵求岛屿数量(LC 200),迷宫最短路、太平洋大西洋
- 更新中....
- 中期:能够举一反三,在 LeetCode 搜索类似题目,最好能够一边讲思路、一边写代码。
- 后期突击:强烈建议大家使用 [codeTop](https://codetop.cc/#/home)。

## Tag

| Tag | 题解分类 |
| :----------------------------------------------------------- | :----------- |
| [Array](https://github.com/LLancelot/LeetCode#array) | 数组 |
| [Two Pointers](https://github.com/LLancelot/LeetCode#two-pointers) | 双指针问题 |
| [DP](https://github.com/LLancelot/LeetCode#dynamic-programming) | 动态规划 |
| [Tree](https://github.com/LLancelot/LeetCode#tree) | 树 |
| [Linked List](https://github.com/LLancelot/LeetCode#linked-list) | 链表 |
| [Subset](https://github.com/LLancelot/LeetCode#subset) | 子集问题 |
| [DFS](https://github.com/LLancelot/LeetCode#depth-first-search) | 深度优先搜索 |
| [BFS](https://github.com/LLancelot/LeetCode#breath-first-search) | 广度优先搜索 |
| [Binary Search](https://github.com/LLancelot/LeetCode#binary-search) | 二分查找 |
| [Greedy](https://github.com/LLancelot/LeetCode#greedy) | 贪心算法 |
| [Graph](https://github.com/LLancelot/LeetCode#graph) | 图 |
| [Sliding Window](https://github.com/LLancelot/LeetCode#sliding-window) | 滑动窗口问题 |
| [Merge Intervals](https://github.com/LLancelot/LeetCode#merge-intervals) | 区间合并问题 |
| [BackTracking](https://github.com/LLancelot/LeetCode#backtracking) | 回溯 |
| [Stack](https://github.com/LLancelot/LeetCode#stack) | 栈 |
| [Bit Manipulation](https://github.com/LLancelot/LeetCode/blob/master/bit-manipulation.md) | 位运算 |
| [Heap](https://github.com/LLancelot/LeetCode#heap--heap-sort) | 堆 |
| [Design](https://github.com/LLancelot/LeetCode#design) | 设计题 |
| [String](https://github.com/LLancelot/LeetCode#string) | 字符串 |
| [Palindrome](https://github.com/LLancelot/LeetCode#palindrome) | 回文串 |

## 题目列表

### Two Pointers

- [Pair with Target Sum (模板)](https://github.com/LLancelot/LeetCode/blob/master/two-pointers.md#%E6%A8%A1%E6%9D%BF%E9%A2%981-easy---pair-with-target-sum)
- [Remove Duplicates (模板)](https://github.com/LLancelot/LeetCode/blob/master/two-pointers.md#%E6%A8%A1%E6%9D%BF%E9%A2%982-easy---remove-duplicates)
- [Triplet Sum to Zero (模板)](https://github.com/LLancelot/LeetCode/blob/master/two-pointers.md#%E6%A8%A1%E6%9D%BF%E9%A2%984-medium---triplet-sum-to-zero)
- [Follow up: Triplet Sum Close to Target](https://github.com/LLancelot/LeetCode/blob/master/two-pointers.md#follow-up-triplet-sum-close-to-target-medium)
- [Subarrays with Product Less than a Target (medium)](https://github.com/LLancelot/LeetCode/blob/master/two-pointers.md#713-subarray-product-less-than-k)
- [Dutch National Flag Problem (medium) / 三色旗 / 颜色分类](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/%E3%80%90Day%2002%E3%80%91%202020-06-02%20-%2075.%20%E9%A2%9C%E8%89%B2%E5%88%86%E7%B1%BB.md#day-2-2020-06-02---75-%E9%A2%9C%E8%89%B2%E5%88%86%E7%B1%BB)
- [4Sum](https://github.com/LLancelot/LeetCode/blob/master/two-pointers.md#18-4sum-quadruple-sum-to-target-medium)
- [1537. Get the Maximum Score (Hard)](https://github.com/LLancelot/LeetCode/blob/709dd61503e93189a45ecce3b4af51b33cdb9fe3/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1537.%20Get%20the%20Maximum%20Score.md#1537-get-the-maximum-score)
- [42. Trapping Rain Water](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/42.%20Trapping%20Rain%20Water.md#42-trapping-rain-water)
- [434. Number of Segments in a String](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/434.%20Number%20of%20Segments%20in%20a%20String.md#434-number-of-segments-in-a-string)

### Dynamic Programming

- [10. Regular Expression Matching 字符匹配](https://github.com/LLancelot/LeetCode/blob/master/String.md#10-regular-expression-matching)
- [45. Jump Game 2](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/45.JumpGameII.md#45-jump-game-ii)
- [91. Decode Ways](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/91.%20Decode%20Ways.md)
- [198. House Robber](https://leetcode.com/problems/house-robber/)
- [337. House Robber III](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/337.%20House%20Robber%20III.md)
- [256. Paint House](https://github.com/LLancelot/LeetCode/issues)
- [265. Paint House 2 (Hard)](https://github.com/LLancelot/LeetCode/issues)
- [221. Maximal Square (Medium)](https://leetcode.com/problems/maximal-square/)
- [494. Target Sum (Medium)](https://leetcode.com/problems/target-sum/)
- [746. Min Cost Climbing Stairs](https://leetcode.com/problems/min-cost-climbing-stairs/)
- [279. Perfect Squares](https://leetcode.com/problems/perfect-squares/)
- [63. Unique Paths](https://leetcode.com/problems/unique-paths/)
- [322. Coin Change](https://leetcode.com/problems/coin-change/)
- [518. Coin Change 2](https://leetcode.com/problems/coin-change-2/)
- [486. Predict the Winner](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#dp-12-486-predict-the-winner)
- [377. Combination Sum IV](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#dp-13-377-combination-sum-iv)
- [131. Palindrome Partitioning 最长回文串划分](https://github.com/LLancelot/LeetCode/blob/32471e93e9fd8e2a3600fe73f02f43c3927f5ccb/LeetCode-Note.md#dp-14-131-palindrome-partitioning)
- [516. Longest Palindromic Subsequence 最长回文串子序列个数](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/516.%20Longest%20Palindromic%20Subsequence.md#516-longest-palindromic-subsequence)
- [139. Word Break](https://github.com/LLancelot/LeetCode/blob/ef7768fcdab975d18890a8b45ba2fef39ec3b57d/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/139.%20Word%20Break.md#139-word-break)
- [1524. Number of Sub-arrays With Odd Sum](https://github.com/LLancelot/LeetCode/blob/c80d74264a7528e5235209bdb8de69a16cb685d1/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1524.%20Number%20of%20Sub-arrays%20With%20Odd%20Sum.md#1524-number-of-sub-arrays-with-odd-sum)
- [403. Frog Jump](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/403.%20Frog%20Jump%20(Hard).md)
- [1423. Maximum Points You Can Obtain from Cards](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1423.%20Maximum%20Points%20You%20Can%20Obtain%20from%20Cards.md)
- [1143. Longest Common Subsequence](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1143.%20Longest%20Common%20Subsequence.md) (经典,模板题)
- [718. Maximum Length of Repeated Subarray](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/718.%20Maximum%20Length%20of%20Repeated%20Subarray.md) (与上题相似)
- [1312. Minimum Insertion Steps to Make a String Palindrome](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1312.%20Minimum%20Insertion%20Steps%20to%20Make%20a%20String%20Palindrome.md) (记忆化递归, DP数组)
- [1155. Number of Dice Rolls With Target Sum](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1155.%20Number%20of%20Dice%20Rolls%20With%20Target%20Sum.md) (记忆化递归, DP数组)
- [1679. Max Number of K-Sum Pairs](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1679.%20Max%20Number%20of%20K-Sum%20Pairs.md) (HashMap)

### Tree

- [96. Unique Binary Search Tree](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#96-unique-binary-search-trees)
- [95. Unique Binary Search Trees II](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#95-unique-binary-search-tree-2)
- [98. Validate a BST](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#98-validate-a-bst)
- [99. Recover Binary Search Tree (Hard)](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/99.%20Recover%20Binary%20Search%20Tree.md#99-recover-binary-search-tree)
- [100. Same Tree (easy)](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#100-same-tree-easy)
- [101. Symmetric Tree (easy)](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#101-symmetric-treeeasy)
- [110. Balanced Binary Tree](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#110-binary-balanced-tree-%E5%B9%B3%E8%A1%A1%E6%A0%91)
- [111. Minimum Depth of Binary Tree](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#111-minimum-depth-of-binary-tree)
- [105. Construct Binary Tree from Preorder and Inorder Traversal](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#105-construct-binary-tree-from-preorder-and-inorder-traversal)
- [108. Convert Sorted Array to Binary Search Tree (Easy)](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#108-convert-sorted-array-to-binary-search-tree-easy)
- [538. Convert BST to Greater Tree](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#538--1038-convert-bst-to-greater-tree)
- [1038. Binary Search Tree to Greater Sum Tree (Same as 538)](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#538--1038-convert-bst-to-greater-tree)
- [107. 层序遍历](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#107-%E5%B1%82%E5%BA%8F%E9%81%8D%E5%8E%86)
- [112. Path Sum](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#112-path-sum)
- [113. Path Sum II](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#113-path-sum-ii--medium)
- [116. Populating Next Right Pointers in Each Node](https://github.com/LLancelot/LeetCode/issues/17)
- [437. Path Sum III (easy)](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#437-path-sum-iii-easy)
- [124. Binary Tree Maximum Path Sum](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#124-binary-tree-maximum-path-sum)
- [306. Find Leaves of Binary Tree](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#306-find-leaves-of-binary-tree)
- [701. Insert into a BST](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#701-insert-into-a-bst)
- [572. Subtree of Another Tree](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#572-subtree-of-another-tree)
- [510. In-order Successor in BST II](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/510.%20In-order%20Successor%20in%20BST%20II.md)
- [449. Serialize and Deserialize BST](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/449.%20Serialize%20and%20Deserialize%20BST.md) (序列化:Node->String 和反序列化: String->Node)
- [236. Lowest Common Ancestor of a Binary Tree](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#236-lowest-common-ancestor-of-a-binary-tree) (经典, LCA 公共祖先问题)
- [1302. Deepest Leaves Sum](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1302.%20Deepest%20Leaves%20Sum.md)

### Linked List

- [19. Remove Nth Node From End of List](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#19-remove-nth-node-from-end-of-list)
- [24. Swap Nodes in Pair](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#24-swap-nodes-in-pair)
- [141. Linked List Cycle](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#141-linked-list-cycle)
- [147. Insertion Sort List](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/147.%20Insertion%20Sort%20List.md)
- [160. Intersection of Two Linked Lists](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#160-intersection-of-two-linked-lists)
- [109. Convert Sorted List to BST](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/%E3%80%90Day%209%E3%80%91%202020-06-09%20-%20109.%20%E6%9C%89%E5%BA%8F%E9%93%BE%E8%A1%A8%E8%BD%AC%E6%8D%A2%E4%BA%8C%E5%8F%89%E6%90%9C%E7%B4%A2%E6%A0%91.md)
- [206. Reverse Linked List (经典 每日一题)](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/%E3%80%90Day%207%E3%80%91%202020-06-07%20-%20206.%20%E5%8F%8D%E8%BD%AC%E9%93%BE%E8%A1%A8.md)
- [25. Reverse Node in k-Group (经典 Hard)](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#25-reverse-nodes-in-k-group)
- [92. Reverse Linked List II (经典)](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#92-reverse-linked-list-ii)
- [328. Odd Even Linked List](https://github.com/LLancelot/LeetCode/blob/32471e93e9fd8e2a3600fe73f02f43c3927f5ccb/LeetCode-Note.md#328-odd-even-linked-list)
- [82. Remove Duplicates from Sorted List II](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/82.%20Remove%20Duplicates%20from%20Sorted%20List%20II.md#82-remove-duplicates-from-sorted-list-ii)

### Depth-First-Search

- [79. Word Search](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#79-word-search)
- [130. Surrounded Regions](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#130-surrounded-regions)
- [200. Numbers of Islands (三种方法, 经典)](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#200-numbers-of-islands-%E7%BB%8F%E5%85%B8)
- [694. Number of Distinct Islands](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#694-number-of-distinct-islands)
- [695. Max Area of Island](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#695-max-area-of-island)
- [547. Friend Circles](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#547-friend-circles)
- [733. Flood Fill (经典)](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#733-flood-fill)
- [967. Numbers With Same Consecutive Differences](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/967.%20Numbers%20With%20Same%20Consecutive%20Differences.md#967-numbers-with-same-consecutive-differences)
- [980. Unique Paths III (Hard)](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/980.%20Unique%20Paths%20III%20(Hard).md)
- [934. Shortest Bridge (BFS + DFS)](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/934.%20Shortest%20Bridge.md#934-shortest-bridge)
- [417. Pacific Atlantic Water Flow](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/417.%20Pacific%20Atlantic%20Water%20Flow.md#417-pacific-atlantic-water-flow) (大平洋大西洋水流, 经典模板题)

### Breath-First-Search

- [207. Course Schedule (经典)](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/%E3%80%90Graph%E3%80%91Course%20Schedule.md#207-course-schedule)
- [210. Course Schedule II (经典)](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/%E3%80%90Graph%E3%80%91Course%20Schedule.md#210-course-schedule-ii)
- [934. Shortest Bridge (BFS + DFS)](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/934.%20Shortest%20Bridge.md#934-shortest-bridge)
- [994. Rotting Oranges](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#994-rotting-oranges)
- [417. Pacific Atlantic Water Flow](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/417.%20Pacific%20Atlantic%20Water%20Flow.md#417-pacific-atlantic-water-flow) (大平洋大西洋水流, 经典模板题)

### Graph

- [207. Course Schedule (经典)](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/%E3%80%90Graph%E3%80%91Course%20Schedule.md#207-course-schedule)
- [210. Course Schedule II (经典)](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/%E3%80%90Graph%E3%80%91Course%20Schedule.md#210-course-schedule-ii)
- [399. Evaluate Division](https://github.com/LLancelot/LeetCode/blob/master/Graph.md#graph-%E5%9B%BE) (Graph + BFS)
- [269. Alien Dictionary](https://github.com/LLancelot/LeetCode/blob/master/Graph.md#269-alien-dictionary) (Graph + BFS)
- [1192. Critical Connections in a Network (Hard)](https://github.com/LLancelot/LeetCode/issues/18)
- [277. Find the Celebrity](https://github.com/LLancelot/LeetCode/blob/master/Graph.md#277-find-the-celebrity)
- [133. Clone Graph](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/133.%20Clone%20Graph.md)
- [863. All Nodes Distance K in Binary Tree](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/863.%20All%20Nodes%20Distance%20K%20in%20Binary%20Tree.md)
- [1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1334.%20Find%20the%20City%20With%20the%20Smallest%20Number%20of%20Neighbors%20at%20a%20Threshold%20Distance.md) (Floyd-warshall 最短路径)
- [684. Redundant Connection](https://github.com/LLancelot/LeetCode/blob/941f86f930f2a3c00195ba079fb332669f470883/Graph.md#684-redundant-connection) (DFS, 并查集Union-Find)

### Greedy

- [1029. Two City Scheduling](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1029.%20Two%20City%20Scheduling.md#1029-two-city-scheduling)
- [406. Queue Reconstruction by Height](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/406.%20Queue%20Reconstruction%20by%20Height.md#406-queue-reconstruction-by-height)
- [435. Non-overlapping Intervals](https://github.com/LLancelot/LeetCode/blob/dd22b18d96c6de27e05ab63a0c0ab15838e9e3ee/merge-intervals.md#leetcode-435-non-overlapping-intervals)

### Binary Search

- [162. Find Peak Element](https://github.com/LLancelot/LeetCode/blob/master/binary-search.md#162-find-peak-element)
- [4. Median of Two Sorted Arrays (Hard)](https://github.com/LLancelot/LeetCode/blob/master/binary-search.md#4-median-of-two-sorted-arrays-hard)
- [729. My Calendar I](https://github.com/LLancelot/LeetCode/blob/master/merge-intervals.md#leetcode-729-my-calendar-i)
- _33. Search in Rotated Sorted Array_
- _34. Find First and Last Position of Element in Sorted Array_
- [74. Search a 2D Matrix](https://github.com/LLancelot/LeetCode/blob/master/binary-search.md#74-search-a-2d-matrix)
- _153. Find Minimum in Rotated Sorted Array_
- _209. Minimum Size Subarray Sum_
- _230. Kth Smallest Element in a BST_
- _240. Search a 2D Matrix II_
- _270. Closest Binary Search Tree Value_
- _287. Find the Duplicate Number_
- _300. Longest Increasing Subsequence_
- [315. Count of Smaller Numbers After Self](https://github.com/LLancelot/LeetCode/issues/10)
- _374. Guess Number Higher or Lower_
- [410. Split Array Largest Sum](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/410.%20Split%20Array%20Largest%20Sum%20(Hard).md#410-split-array-largest-sum-hard) (经典Hard, 二分+贪心)
- [_875. Koko Eating Bananas_](https://leetcode.com/problems/koko-eating-bananas/)
- [1283. Find the Smallest Divisor Given a Threshold](https://github.com/LLancelot/LeetCode/blob/master/binary-search.md#1283-find-the-smallest-divisor-given-a-threshold)
- _1337. The K Weakest Rows in a Matrix_
- _1351. Count Negative Numbers in a Sorted Matrix_

### Sliding Window

- [3. Longest Substring Without Repeating Characters](https://github.com/LLancelot/LeetCode/blob/master/sliding-window.md#3-longest-substring-without-repeating-characters)
- [340. Longest Substring with At Most K Distinct Characters](https://github.com/LLancelot/LeetCode/blob/b389a2b57478bb4f905564aae569b3cfd274724c/sliding-window.md#340-longest-substring-with-at-most-k-distinct-characters)
- [76. Minimum Window Substring](https://github.com/LLancelot/LeetCode/blob/master/sliding-window.md#sliding-window)
- [30. Substring with Concatenation of All Words](https://github.com/LLancelot/LeetCode/blob/master/sliding-window.md#30-substring-with-concatenation-of-all-words)
- [模板题:String Anagrams (hard)](https://www.educative.io/courses/grokking-the-coding-interview/xl2g3vxrMq3)
- [模板题:Permutation in a String (hard)](https://www.educative.io/courses/grokking-the-coding-interview/N0o9QnPLKNv)

### Merge Intervals (区间问题)

- [模板题: Merge Intervals (合并区间)](https://github.com/LLancelot/LeetCode/blob/master/merge-intervals.md#%E6%A8%A1%E6%9D%BF%E9%A2%981---merge-intervals)
- [模板题: Insert Interval (插入区间)](https://github.com/LLancelot/LeetCode/blob/master/merge-intervals.md#%E6%A8%A1%E6%9D%BF%E9%A2%982---insert-interval)
- [模板题: Intervals Intersection (查找交集)](https://github.com/LLancelot/LeetCode/blob/master/merge-intervals.md#%E6%A8%A1%E6%9D%BF%E9%A2%983---interval-intersection)
- [模板题: Conflicting Appointments (冲突区间)](https://github.com/LLancelot/LeetCode/blob/master/merge-intervals.md#%E6%A8%A1%E6%9D%BF%E9%A2%984---conflicting-appointments)
- [模板题: Minimum Meeting Rooms (最少的会议室)](https://github.com/LLancelot/LeetCode/blob/master/merge-intervals.md#leetcode-253-meeting-rooms-ii)
- Maximum CPU Load
- [Employee Free Time (Hard)](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/759.%20Employee%20Free%20Time.md#759-employee-free-time)
- [729. My Calendar I](https://github.com/LLancelot/LeetCode/blob/master/merge-intervals.md#leetcode-729-my-calendar-i)
- [435. Non-overlapping Intervals](https://github.com/LLancelot/LeetCode/blob/dd22b18d96c6de27e05ab63a0c0ab15838e9e3ee/merge-intervals.md#leetcode-435-non-overlapping-intervals) (**Greedy** Method)
- [1272. Remove Interval](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1272.%20Remove%20Interval.md)

### Subset

- [78. Subsets](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#1-78-subset)
- [90. Subsets II](https://github.com/LLancelot/LeetCode/blob/master/LeetCode-Note.md#2-90-subset)

### BackTracking

- [17. Letter Combinations of a Phone Number](https://github.com/LLancelot/LeetCode/blob/master/recursion-backtracking.md)
- [22. Generate Parentheses](https://github.com/LLancelot/LeetCode/blob/master/recursion-backtracking.md#median-22-generate-parentheses)
- [51. N皇后问题](https://github.com/LLancelot/LeetCode/blob/master/recursion-backtracking.md#hard--51-n-queens)
- [46. Permutation](https://github.com/LLancelot/LeetCode/blob/master/recursion-backtracking.md#46-permutation)
- [47. Permutations II](https://github.com/LLancelot/LeetCode/blob/master/recursion-backtracking.md#47-permutations-ii)
- [216. Combination Sum III](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/216.%20Combination%20Sum%20III.md)
- [1718. Construct the Lexicographically Largest Valid Sequence](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1718.%20Construct%20the%20Lexicographically%20Largest%20Valid%20Sequence.md) (回溯, 暴力搜索)

### Stack

- [84. Largest Rectangle in Histogram 直方图最大面积](https://github.com/LLancelot/LeetCode/blob/master/stack.md#84-largest-rectangle-in-histogram-%E5%8D%95%E8%B0%83%E6%A0%88%E7%B3%BB%E5%88%97)
- [232. Implement Queue using Stacks 利用栈实现队列](https://github.com/LLancelot/LeetCode/blob/master/stack.md#232-implement-queue-using-stacks)
- [402. Remove K Digits](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/402.%20Remove%20K%20Digits.md)
- [946. Validate Stack Sequences](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/946.%20Validate%20Stack%20Sequences.md#946-validate-stack-sequences)
- [71. Simplify Path](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/71.%20Simplify%20Path.md#71-simplify-path)
- [739. Daily Temperatures](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/739.%20Daily%20Temperatures.md)

### Heap / Heap Sort

- [973. K Closest Points to Origin (Medium)](https://github.com/LLancelot/LeetCode/blob/master/heap.md#973-k-closest-points-to-origin-medium)
- [378. Kth Smallest Element in a Sorted Matrix](https://github.com/LLancelot/LeetCode/blob/master/heap.md#378-kth-smallest-element-in-a-sorted-matrix)
- [295. Find Median from Data Stream (Hard)](https://github.com/LLancelot/LeetCode/blob/8637033cb683b7b718dad7bc51c74c0a58bca0fe/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/295.%20Find%20Median%20from%20Data%20Stream.md#295-find-median-from-data-stream)

### Design

- [146. LRU Cache (每日一题)](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/%E3%80%90Day%2012%E3%80%91-%20146.%20LRU%E7%BC%93%E5%AD%98%E6%9C%BA%E5%88%B6.md)
- [380. Insert Delete GetRandom O(1) (每日一题)](https://github.com/LLancelot/LeetCode/blob/bed167dfe9cd188c99ee76d4d01379d82386eca4/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/%E3%80%90Day%206%E3%80%91%202020-06-06%20-%20380.%20%E5%B8%B8%E6%95%B0%E6%97%B6%E9%97%B4%E6%8F%92%E5%85%A5%E3%80%81%E5%88%A0%E9%99%A4%E5%92%8C%E8%8E%B7%E5%8F%96%E9%9A%8F%E6%9C%BA%E5%85%83%E7%B4%A0.md)
- [208. Implement Trie (Prefix Tree)](https://github.com/LLancelot/LeetCode/blob/master/Design.md#208-implement-trie-prefix-tree)
- [212. Word Search II](https://github.com/LLancelot/LeetCode/blob/master/Design.md#212-word-search-ii)
- [211. Add and Search Word - Data structure design](https://github.com/LLancelot/LeetCode/blob/master/Design.md#211-add-and-search-word---data-structure-design)
- [1286. Iterator for Combination](https://github.com/LLancelot/LeetCode/blob/master/recursion-backtracking.md#1286-iterator-for-combination) (Google)
- [1032. Stream of Characters (Use Trie)](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1032.%20Stream%20of%20Characters.md)
- [362. Design Hit Counter](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/362.%20Design%20Hit%20Counter.md#362-design-hit-counter)

### Array

- [41. First Missing Positive](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/41.%20First%20Missing%20Positive.md#41-first-missing-positive)
- [238. Product of Array Except Self](https://github.com/LLancelot/LeetCode/blob/master/Array.md#238-product-of-array-except-self-medium)
- [179. Largest Number](https://github.com/LLancelot/LeetCode/blob/cc993b5461a24994e2be233fad8ed8f340135868/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/179.%20Largest%20Number.md#179-largest-number)
- [498. Diagonal Traverse](https://github.com/LLancelot/LeetCode/blob/b095df0dd886c953108f989520fb52cab6198b21/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/498.%20Diagonal%20Traverse.md#498-diagonal-traverse)
- [334. Increasing Triplet Subsequence](https://github.com/LLancelot/LeetCode/blob/master/Array.md)
- [442. Find All Duplicates in an Array](https://github.com/LLancelot/LeetCode/blob/master/Array.md#442-find-all-duplicates-in-an-array)
- [406. Queue Reconstruction by Height](https://github.com/LLancelot/LeetCode/blob/b95a1b6afe8c201f6d07025da2c4403d43759165/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/406.%20Queue%20Reconstruction%20by%20Height.md#406-queue-reconstruction-by-height)
- [624. Maximum Distance in Arrays](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/624.%20Maximum%20Distance%20in%20Arrays.md#624-maximum-distance-in-arrays)
- [910. Smallest Range II](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/910.%20Smallest%20Range%20II.md)
- [243. Shortest Word Distance](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/243.%20Shortest%20Word%20Distance.md)
- [153. Find Minimum in Rotated Sorted Array](https://github.com/LLancelot/LeetCode/blob/dd488b78adc1bd9b67433612ade8874778ef3586/binary-search.md#153-find-minimum-in-rotated-sorted-array) (无重复元素)
- [154. Find Minimum in Rotated Sorted Array II](https://github.com/LLancelot/LeetCode/blob/dd488b78adc1bd9b67433612ade8874778ef3586/binary-search.md#154-find-minimum-in-rotated-sorted-array-ii) (有重复元素)
- [1413. Minimum Value to Get Positive Step by Step Sum](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1413.%20Minimum%20Value%20to%20Get%20Positive%20Step%20by%20Step%20Sum.md)

### String

- [10. Regular Expression Matching 字符匹配](https://github.com/LLancelot/LeetCode/blob/master/String.md#10-regular-expression-matching)
- [32. Longest Valid Parentheses (经典)](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/32.%20Longest%20Valid%20Parentheses.md#32-longest-valid-parentheses)
- [38. Count and Say](https://github.com/LLancelot/LeetCode/blob/master/String.md#38-count-and-say)
- [44. Wildcard Matching 万卡匹配](https://github.com/LLancelot/LeetCode/blob/fb237e22cb32219232def5d98f5db9e674d3ff6a/String.md#44-wildcard-matching)
- [97. Interleaving String (hard)](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/97.%20Interleaving%20String%20(hard).md)
- [929. Unique Email Addresses](https://github.com/LLancelot/LeetCode/blob/cc993b5461a24994e2be233fad8ed8f340135868/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/929.UniqueEmailAddresses.md)
- [1041. Robot Bounded In Circle](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1041.%20Robot%20Bounded%20In%20Circle.md#1041-robot-bounded-in-circle)
- [763. Partition Labels](https://github.com/LLancelot/LeetCode/blob/cc993b5461a24994e2be233fad8ed8f340135868/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/763.%20Partition%20Labels.md)
- [1505. Minimum Possible Integer After at Most K Adjacent Swaps On Digits](https://github.com/LLancelot/LeetCode/blob/cc993b5461a24994e2be233fad8ed8f340135868/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1505.%20Minimum%20Possible%20Integer%20After%20at%20Most%20K%20Adjacent%20Swaps%20On%20Digits.md#leetcode-1505-minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits)
- [1291. Sequential Digits](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1291.%20Sequential%20Digits.md)
- [468. Validate IP Address](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/468.%20Validate%20IP%20Address.md)
- [556. Next Greater Element III](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/556.%20Next%20Greater%20Element%20III.md#556-next-greater-element-iii)

### Palindrome

- [5. Longest Palindromic Substring (经典)](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/5.%20Longest%20Palindromic%20Substring.md#5-longest-palindromic-substring)
- [131. Palindrome Partitioning](https://github.com/LLancelot/LeetCode/blob/32471e93e9fd8e2a3600fe73f02f43c3927f5ccb/LeetCode-Note.md#dp-14-131-palindrome-partitioning)
- *214. Shortest Palindrome (Hard)*
- *234. Palindrome Linked List (Easy)*
- *266. Palindrome Permutation (Easy)*
- *336.Palindrome Pairs (Hard, **Amazon**)*
- [409. Longest Palindrome](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/409.%20Longest%20Palindrome.md#409-longest-palindrome)
- [516. Longest Palindromic Subsequence](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/516.%20Longest%20Palindromic%20Subsequence.md#516-longest-palindromic-subsequence)
- [647. Palindromic Substrings](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/647.%20Palindromic%20Substrings.md#647-palindromic-substrings)
- [1312. Minimum Insertion Steps to Make a String Palindrome](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/1312.%20Minimum%20Insertion%20Steps%20to%20Make%20a%20String%20Palindrome.md) (记忆化递归, DP数组)
- [680. Valid Palindrome II](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/680.%20Valid%20Palindrome%20II.md#680-valid-palindrome-ii) (Easy)

### Bit Manipulation

- [421. Maximum XOR of Two Numbers in an Array (Use Trie)](https://github.com/LLancelot/LeetCode/blob/master/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98/421.%20Maximum%20XOR%20of%20Two%20Numbers%20in%20an%20Array.md)
-