# 4.5 LeetCode 题目

## 1. 排序

1. [912. 排序数组（M）](https://leetcode.cn/problems/sort-an-array/)
2. [1122. 数组的相对排序（E）](https://leetcode.cn/problems/relative-sort-array/)
3. [56. 合并区间（M）](https://leetcode.cn/problems/merge-intervals/)
4. [215. 数组中的第K个最大元素（M）](https://leetcode.cn/problems/kth-largest-element-in-an-array/)
5. [货仓选址（M）](https://www.acwing.com/problem/content/description/106/)
6. [493. 翻转对（H）](https://leetcode.cn/problems/reverse-pairs/)
7. [327. 区间和的个数（H）](https://leetcode.cn/problems/count-of-range-sum/)

## 2. 贪心

1. [322. 零钱兑换（M）](https://leetcode-cn.com/problems/coin-change/)
2. [860. 柠檬水找零（E）](https://leetcode-cn.com/problems/lemonade-change/)
3. [455. 分发饼干（E）](https://leetcode-cn.com/problems/assign-cookies/)
4. [122. 买卖股票的最佳时机 II（M）](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii/)
5. [45. 跳跃游戏 II（M）](https://leetcode-cn.com/problems/jump-game-ii/)
6. [1665. 完成所有任务的最少初始能量（H）](https://leetcode-cn.com/problems/minimum-initial-energy-to-finish-tasks/)

## 3. 动态规划

### 3.1 简单的线性动规

1. [322. 零钱兑换（M）](https://leetcode-cn.com/problems/coin-change/)
2. [63. 不同路径 II（M）](https://leetcode-cn.com/problems/unique-paths-ii/)
3. [1143. 最长公共子序列（M）](https://leetcode-cn.com/problems/longest-common-subsequence/)
4. [300. 最长递增子序列（M）](https://leetcode-cn.com/problems/longest-increasing-subsequence/)
5. [53. 最大子数组和（E）](https://leetcode-cn.com/problems/maximum-subarray/)
6. [152. 乘积最大子数组（M）](https://leetcode-cn.com/problems/maximum-product-subarray/)
7. [70. 爬楼梯（E）](https://leetcode-cn.com/problems/climbing-stairs/)
8. [120. 三角形最小路径和（M）](https://leetcode-cn.com/problems/triangle/)
9. [673. 最长递增子序列的个数（M）](https://leetcode-cn.com/problems/number-of-longest-increasing-subsequence/)

### 3.2 复杂的线性动规

#### 3.2.1 买卖股票系列

1. [121. 买卖股票的最佳时机（E）](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/)
2. [122. 买卖股票的最佳时机 II（M）](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii/)
3. [123. 买卖股票的最佳时机 III（H）](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-iii/)
4. [188. 买卖股票的最佳时机 IV（H）](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-iv/)
5. [714. 买卖股票的最佳时机含手续费（M）](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/)
6. [309. 最佳买卖股票时机含冷冻期（M）](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/)

#### 3.2.2 线性动规

1. [198. 打家劫舍（M）](https://leetcode-cn.com/problems/house-robber/)
2. [213. 打家劫舍 II（M）](https://leetcode-cn.com/problems/house-robber-ii/)：环形 DP
3. [72. 编辑距离（H）](https://leetcode-cn.com/problems/edit-distance/)：重点题
4. [55. 跳跃游戏（M）](https://leetcode-cn.com/problems/jump-game/)
5. [45. 跳跃游戏 II（M）](https://leetcode-cn.com/problems/jump-game-ii/)

#### 3.2.3 背包

1. [416. 分割等和子集（M）](https://leetcode-cn.com/problems/partition-equal-subset-sum/)
2. [518. 零钱兑换 II（M）](https://leetcode-cn.com/problems/coin-change-2/)
3. [279. 完全平方数（M）](https://leetcode-cn.com/problems/perfect-squares/)

### 3.3 更多

#### 3.3.1 动规的优化

1. [1499. 满足不等式的最大值（H）](https://leetcode-cn.com/problems/max-value-of-equation/)
2. [918. 环形子数组的最大和（M）](https://leetcode-cn.com/problems/maximum-sum-circular-subarray/)

#### 3.3.2 区间动规

1. [312. 戳气球（H）](https://leetcode-cn.com/problems/burst-balloons/)
2. [1000. 合并石头的最低成本（H）](https://leetcode-cn.com/problems/minimum-cost-to-merge-stones/)
3. [516. 最长回文子序列（M）](https://leetcode-cn.com/problems/longest-palindromic-subsequence/)

#### 3.3.3 树形动规

1. [337. 打家劫舍 III（M）](https://leetcode-cn.com/problems/house-robber-iii/)
2. [124. 二叉树中的最大路径和（H）](https://leetcode-cn.com/problems/binary-tree-maximum-path-sum/)

## 4. 图论

### 4.1 最短路

1. [743. 网络延迟时间（M）](https://leetcode.cn/problems/network-delay-time/)
2. [ACW（M）](https://www.acwing.com/activity/content/11/)
3. [1334. 阈值距离内邻居最少的城市（M）](https://leetcode.cn/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/)

### 4.2 最小生成树

1. [1584. 连接所有点的最小费用（M）](https://leetcode.cn/problems/min-cost-to-connect-all-points/)

### 4.3 高级搜索

#### 4.3.1 搜索剪枝

1. [22. 括号生成（M）](https://leetcode-cn.com/problems/generate-parentheses/)
2. [51. N 皇后（H）](https://leetcode-cn.com/problems/n-queens/)
3. [36. 有效的数独（M）](https://leetcode-cn.com/problems/valid-sudoku/)
4. [37. 解数独（H）](https://leetcode-cn.com/problems/sudoku-solver/)

#### 4.3.2 迭代加深+折半搜索+双向搜索

1. [127. 单词接龙（H）](https://leetcode-cn.com/problems/word-ladder/)

#### 4.3.3 启发式搜索：A\*算法

1. [773. 滑动谜题（H）](https://leetcode-cn.com/problems/sliding-puzzle/)
2. [ACW\_845. 八数码（M）](https://www.acwing.com/problem/content/847/)
3. [ACW\_179. 八数码（M）](https://www.acwing.com/problem/content/181/)
4. [1091. 二进制矩阵中的最短路径（M）](https://leetcode-cn.com/problems/shortest-path-in-binary-matrix/)：BFS, 双向 BFS, A\*
