# 第五章 - 高頻考題(中等)
# 中等難度題目合集
中等題目是力扣比例最大的部分,因此這部分我的題解也是最多的。 大家不要太過追求難題,先把中等難度題目做熟了再說。
這部分的題目要不需要我們挖掘題目的內含信息, 將其抽象成簡單題目。 要么是一些寫起來比較麻煩的題目, 一些人編碼能力不行就掛了。因此大家一定要自己做, 即使看了題解”會了“,也要自己碼一遍。自己不親自寫一遍,里面的細節永遠不知道。
- [面試題 17.09. 第 k 個數](get-kth-magic-number-lcci.md)
- [0002.add-two-numbers](2.add-two-numbers.html)
- [0003.longest-substring-without-repeating-characters](3.longest-substring-without-repeating-characters.html)
- [0005.longest-palindromic-substring](5.longest-palindromic-substring.html)
- [0011.container-with-most-water](11.container-with-most-water.html)
- [0015.3-sum](15.3sum.html)
- [0017.Letter-Combinations-of-a-Phone-Number](17.Letter-Combinations-of-a-Phone-Number.html) ??
- [0019. Remove Nth Node From End of List](19.removeNthNodeFromEndofList.html)
- [0022.generate-parentheses.md](22.generate-parentheses.html) ??
- [0024. Swap Nodes In Pairs](24.swapNodesInPairs.html)
- [0029.divide-two-integers](29.divide-two-integers.html)
- [0031.next-permutation](31.next-permutation.html)
- [0033.search-in-rotated-sorted-array](33.search-in-rotated-sorted-array.html)
- [0039.combination-sum](39.combination-sum.html)
- [0040.combination-sum-ii](40.combination-sum-ii.html)
- [0046.permutations](46.permutations.html)
- [0047.permutations-ii](47.permutations-ii.html)
- [0048.rotate-image](48.rotate-image.html)
- [0049.group-anagrams](49.group-anagrams.html)
- [0050.pow-x-n](50.pow-x-n.html) ??
- [0055.jump-game](55.jump-game.html)
- [0056.merge-intervals](56.merge-intervals.html)
- [0060.permutation-sequence](60.permutation-sequence.html) ??
- [0062.unique-paths](62.unique-paths.html) ??
- [0073.set-matrix-zeroes](73.set-matrix-zeroes.html)
- [0075.sort-colors](75.sort-colors.html)
- [0078.subsets](78.subsets.html)
- [0079.word-search](79.word-search.html)
- [0080.remove-duplicates-from-sorted-array-ii](80.remove-duplicates-from-sorted-array-ii.html) ??
- [0086.partition-list](86.partition-list.html)
- [0090.subsets-ii](90.subsets-ii.html)
- [0091.decode-ways](91.decode-ways.html)
- [0092.reverse-linked-list-ii](92.reverse-linked-list-ii.html) ??
- [0094.binary-tree-inorder-traversal](94.binary-tree-inorder-traversal.html)
- [0095.unique-binary-search-trees-ii](95.unique-binary-search-trees-ii.html) ??
- [0096.unique-binary-search-trees](96.unique-binary-search-trees.html) ??
- [0098.validate-binary-search-tree](98.validate-binary-search-tree.html)
- [0102.binary-tree-level-order-traversal](102.binary-tree-level-order-traversal.html)
- [0103.binary-tree-zigzag-level-order-traversal](103.binary-tree-zigzag-level-order-traversal.html)
- [105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md](105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.html)
- [0113.path-sum-ii](113.path-sum-ii.html)
- [0129.sum-root-to-leaf-numbers](129.sum-root-to-leaf-numbers.html)
- [0130.surrounded-regions](130.surrounded-regions.html)
- [0131.palindrome-partitioning](131.palindrome-partitioning.html)
- [0139.word-break](139.word-break.html)
- [0144.binary-tree-preorder-traversal](144.binary-tree-preorder-traversal.html)
- [0150.evaluate-reverse-polish-notation](150.evaluate-reverse-polish-notation.html)
- [0152.maximum-product-subarray](152.maximum-product-subarray.html) ??
- [0199.binary-tree-right-side-view](199.binary-tree-right-side-view.html)
- [0200.number-of-islands](200.number-of-islands.html) ??
- [0201.bitwise-and-of-numbers-range](201.bitwise-and-of-numbers-range.html) ??
- [0208.implement-trie-prefix-tree](208.implement-trie-prefix-tree.html)
- [0209.minimum-size-subarray-sum](209.minimum-size-subarray-sum.html)
- [0211.add-and-search-word-data-structure-design](211.add-and-search-word-data-structure-design.html) ??
- [0215.kth-largest-element-in-an-array](215.kth-largest-element-in-an-array.html) ??
- [0221.maximal-square](221.maximal-square.html)
- [0229.majority-element-ii](229.majority-element-ii.html) ??
- [0230.kth-smallest-element-in-a-bst](230.kth-smallest-element-in-a-bst.html)
- [0236.lowest-common-ancestor-of-a-binary-tree](236.lowest-common-ancestor-of-a-binary-tree.html)
- [0238.product-of-array-except-self](238.product-of-array-except-self.html)
- [0240.search-a-2-d-matrix-ii](240.search-a-2-d-matrix-ii.html)
- [0279.perfect-squares](279.perfect-squares.html)
- [0309.best-time-to-buy-and-sell-stock-with-cooldown](309.best-time-to-buy-and-sell-stock-with-cooldown.html)
- [0322.coin-change](322.coin-change.html)
- [0328.odd-even-linked-list](328.odd-even-linked-list.html)
- [0334.increasing-triplet-subsequence](334.increasing-triplet-subsequence.html)
- [0337.house-robber-iii.md](337.house-robber-iii.html)
- [0343.integer-break](343.integer-break.html)??
- [0365.water-and-jug-problem](365.water-and-jug-problem.html)
- [0378.kth-smallest-element-in-a-sorted-matrix](378.kth-smallest-element-in-a-sorted-matrix.html)
- [0380.insert-delete-getrandom-o1](380.insert-delete-getrandom-o1.html)
- [0416.partition-equal-subset-sum](416.partition-equal-subset-sum.html)??
- [0445.add-two-numbers-ii](445.add-two-numbers-ii.html)
- [0454.4-sum-ii](454.4-sum-ii.html)
- [0474.ones-and-zeros](474.ones-and-zeros-en.md)
- [0494.target-sum](494.target-sum.html)
- [0516.longest-palindromic-subsequence](516.longest-palindromic-subsequence.html)
- [0518.coin-change-2](518.coin-change-2.html)
- [0547.friend-circles](547.friend-circles-en.md)
- [0560.subarray-sum-equals-k](560.subarray-sum-equals-k.html)
- [0609.find-duplicate-file-in-system](609.find-duplicate-file-in-system.html)
- [0611.valid-triangle-number](611.valid-triangle-number.html)
- [0718.maximum-length-of-repeated-subarray](718.maximum-length-of-repeated-subarray.html)
- [0754.reach-a-number.md](754.reach-a-number.html) ??
- [0785.is-graph-bipartite](785.is-graph-bipartite.html) ??
- [0820.short-encoding-of-words](820.short-encoding-of-words.html) ??
- [0875.koko-eating-bananas](875.koko-eating-bananas.html)
- [0877.stone-game](877.stone-game.html)
- [0886.possible-bipartition](886.possible-bipartition.html) ??
- [0900.rle-iterator](900.rle-iterator.html)
- [0912.sort-an-array](912.sort-an-array.html)
- [0935.knight-dialer](935.knight-dialer.html) ??
- [1011.capacity-to-ship-packages-within-d-days](1011.capacity-to-ship-packages-within-d-days.html)
- [1014.best-sightseeing-pair](1014.best-sightseeing-pair.html) ??
- [1015.smallest-integer-divisible-by-k](1015.smallest-integer-divisible-by-k.html)
- [1019.next-greater-node-in-linked-list](1019.next-greater-node-in-linked-list.html) ??
- [1020.number-of-enclaves](1020.number-of-enclaves.html)
- [1023.camelcase-matching](1023.camelcase-matching.html)
- [1031.maximum-sum-of-two-non-overlapping-subarrays](1031.maximum-sum-of-two-non-overlapping-subarrays.html)
- [1104.path-in-zigzag-labelled-binary-tree](1104.path-in-zigzag-labelled-binary-tree.html)
- [1131.maximum-of-absolute-value-expression](1131.maximum-of-absolute-value-expression.html)
- [1186.maximum-subarray-sum-with-one-deletion](1186.maximum-subarray-sum-with-one-deletion.html) ??
- [1218.longest-arithmetic-subsequence-of-given-difference](1218.longest-arithmetic-subsequence-of-given-difference.html)
- [1227.airplane-seat-assignment-probability](1227.airplane-seat-assignment-probability.html)
- [1261.find-elements-in-a-contaminated-binary-tree](1261.find-elements-in-a-contaminated-binary-tree.html)
- [1262.greatest-sum-divisible-by-three](1262.greatest-sum-divisible-by-three.html)
- [1297.maximum-number-of-occurrences-of-a-substring](1297.maximum-number-of-occurrences-of-a-substring.html)
- [1310.xor-queries-of-a-subarray](1310.xor-queries-of-a-subarray.html) ??
- [1334.find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance](1334.find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance.html) ??
- [1371.find-the-longest-substring-containing-vowels-in-even-counts](1371.find-the-longest-substring-containing-vowels-in-even-counts.html) ??
- Introduction
- 第一章 - 算法專題
- 數據結構
- 基礎算法
- 二叉樹的遍歷
- 動態規劃
- 哈夫曼編碼和游程編碼
- 布隆過濾器
- 字符串問題
- 前綴樹專題
- 《貪婪策略》專題
- 《深度優先遍歷》專題
- 滑動窗口(思路 + 模板)
- 位運算
- 設計題
- 小島問題
- 最大公約數
- 并查集
- 前綴和
- 平衡二叉樹專題
- 第二章 - 91 天學算法
- 第一期講義-二分法
- 第一期講義-雙指針
- 第二期
- 第三章 - 精選題解
- 《日程安排》專題
- 《構造二叉樹》專題
- 字典序列刪除
- 百度的算法面試題 * 祖瑪游戲
- 西法的刷題秘籍】一次搞定前綴和
- 字節跳動的算法面試題是什么難度?
- 字節跳動的算法面試題是什么難度?(第二彈)
- 《我是你的媽媽呀》 * 第一期
- 一文帶你看懂二叉樹的序列化
- 穿上衣服我就不認識你了?來聊聊最長上升子序列
- 你的衣服我扒了 * 《最長公共子序列》
- 一文看懂《最大子序列和問題》
- 第四章 - 高頻考題(簡單)
- 面試題 17.12. BiNode
- 0001. 兩數之和
- 0020. 有效的括號
- 0021. 合并兩個有序鏈表
- 0026. 刪除排序數組中的重復項
- 0053. 最大子序和
- 0088. 合并兩個有序數組
- 0101. 對稱二叉樹
- 0104. 二叉樹的最大深度
- 0108. 將有序數組轉換為二叉搜索樹
- 0121. 買賣股票的最佳時機
- 0122. 買賣股票的最佳時機 II
- 0125. 驗證回文串
- 0136. 只出現一次的數字
- 0155. 最小棧
- 0167. 兩數之和 II * 輸入有序數組
- 0169. 多數元素
- 0172. 階乘后的零
- 0190. 顛倒二進制位
- 0191. 位1的個數
- 0198. 打家劫舍
- 0203. 移除鏈表元素
- 0206. 反轉鏈表
- 0219. 存在重復元素 II
- 0226. 翻轉二叉樹
- 0232. 用棧實現隊列
- 0263. 丑數
- 0283. 移動零
- 0342. 4的冪
- 0349. 兩個數組的交集
- 0371. 兩整數之和
- 0437. 路徑總和 III
- 0455. 分發餅干
- 0575. 分糖果
- 0874. 模擬行走機器人
- 1260. 二維網格遷移
- 1332. 刪除回文子序列
- 第五章 - 高頻考題(中等)
- 0002. 兩數相加
- 0003. 無重復字符的最長子串
- 0005. 最長回文子串
- 0011. 盛最多水的容器
- 0015. 三數之和
- 0017. 電話號碼的字母組合
- 0019. 刪除鏈表的倒數第N個節點
- 0022. 括號生成
- 0024. 兩兩交換鏈表中的節點
- 0029. 兩數相除
- 0031. 下一個排列
- 0033. 搜索旋轉排序數組
- 0039. 組合總和
- 0040. 組合總和 II
- 0046. 全排列
- 0047. 全排列 II
- 0048. 旋轉圖像
- 0049. 字母異位詞分組
- 0050. Pow(x, n)
- 0055. 跳躍游戲
- 0056. 合并區間
- 0060. 第k個排列
- 0062. 不同路徑
- 0073. 矩陣置零
- 0075. 顏色分類
- 0078. 子集
- 0079. 單詞搜索
- 0080. 刪除排序數組中的重復項 II
- 0086. 分隔鏈表
- 0090. 子集 II
- 0091. 解碼方法
- 0092. 反轉鏈表 II
- 0094. 二叉樹的中序遍歷
- 0095. 不同的二叉搜索樹 II
- 0096. 不同的二叉搜索樹
- 0098. 驗證二叉搜索樹
- 0102. 二叉樹的層序遍歷
- 0103. 二叉樹的鋸齒形層次遍歷
- 105. 從前序與中序遍歷序列構造二叉樹
- 0113. 路徑總和 II
- 0129. 求根到葉子節點數字之和
- 0130. 被圍繞的區域
- 0131. 分割回文串
- 0139. 單詞拆分
- 0144. 二叉樹的前序遍歷
- 0150. 逆波蘭表達式求值
- 0152. 乘積最大子數組
- 0199. 二叉樹的右視圖
- 0200. 島嶼數量
- 0201. 數字范圍按位與
- 0208. 實現 Trie (前綴樹)
- 0209. 長度最小的子數組
- 0211. 添加與搜索單詞 * 數據結構設計
- 0215. 數組中的第K個最大元素
- 0221. 最大正方形
- 0229. 求眾數 II
- 0230. 二叉搜索樹中第K小的元素
- 0236. 二叉樹的最近公共祖先
- 0238. 除自身以外數組的乘積
- 0240. 搜索二維矩陣 II
- 0279. 完全平方數
- 0309. 最佳買賣股票時機含冷凍期
- 0322. 零錢兌換
- 0328. 奇偶鏈表
- 0334. 遞增的三元子序列
- 0337. 打家劫舍 III
- 0343. 整數拆分
- 0365. 水壺問題
- 0378. 有序矩陣中第K小的元素
- 0380. 常數時間插入、刪除和獲取隨機元素
- 0416. 分割等和子集
- 0445. 兩數相加 II
- 0454. 四數相加 II
- 0494. 目標和
- 0516. 最長回文子序列
- 0518. 零錢兌換 II
- 0547. 朋友圈
- 0560. 和為K的子數組
- 0609. 在系統中查找重復文件
- 0611. 有效三角形的個數
- 0718. 最長重復子數組
- 0754. 到達終點數字
- 0785. 判斷二分圖
- 0820. 單詞的壓縮編碼
- 0875. 愛吃香蕉的珂珂
- 0877. 石子游戲
- 0886. 可能的二分法
- 0900. RLE 迭代器
- 0912. 排序數組
- 0935. 騎士撥號器
- 1011. 在 D 天內送達包裹的能力
- 1014. 最佳觀光組合
- 1015. 可被 K 整除的最小整數
- 1019. 鏈表中的下一個更大節點
- 1020. 飛地的數量
- 1023. 駝峰式匹配
- 1031. 兩個非重疊子數組的最大和
- 1104. 二叉樹尋路
- 1131.絕對值表達式的最大值
- 1186. 刪除一次得到子數組最大和
- 1218. 最長定差子序列
- 1227. 飛機座位分配概率
- 1261. 在受污染的二叉樹中查找元素
- 1262. 可被三整除的最大和
- 1297. 子串的最大出現次數
- 1310. 子數組異或查詢
- 1334. 閾值距離內鄰居最少的城市
- 1371.每個元音包含偶數次的最長子字符串
- 第六章 - 高頻考題(困難)
- 0004. 尋找兩個正序數組的中位數
- 0023. 合并K個升序鏈表
- 0025. K 個一組翻轉鏈表
- 0030. 串聯所有單詞的子串
- 0032. 最長有效括號
- 0042. 接雨水
- 0052. N皇后 II
- 0084. 柱狀圖中最大的矩形
- 0085. 最大矩形
- 0124. 二叉樹中的最大路徑和
- 0128. 最長連續序列
- 0145. 二叉樹的后序遍歷
- 0212. 單詞搜索 II
- 0239. 滑動窗口最大值
- 0295. 數據流的中位數
- 0301. 刪除無效的括號
- 0312. 戳氣球
- 0335. 路徑交叉
- 0460. LFU緩存
- 0472. 連接詞
- 0488. 祖瑪游戲
- 0493. 翻轉對
- 0887. 雞蛋掉落
- 0895. 最大頻率棧
- 1032. 字符流
- 1168. 水資源分配優化
- 1449. 數位成本和為目標值的最大數字
- 后序