# LeetCode **Repository Path**: modnar/LeetCode ## Basic Information - **Project Name**: LeetCode - **Description**: Modnar的LeetCode刷题之旅! - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-02-21 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # LeetCode         **Modnar**的**LeetCode**刷题之旅。 | 标记 | 标记涵义 | 标记 | 标记涵义 | | ---- | -------- | ---- | -------- | | ❌ | 初次尝试时思路出错 | ⚠️ | 警告!需要及时复习| | 🤔 | 感谢他人的题解思路、需要再回顾思考 | ⭐️ | 我认为的好题/好代码 | | ✅ | 自2020.03.01开始的打卡活动完成打卡 | 🐧 | 腾讯精选练习50题 | | 👨‍💻 | 精选TOP面试题 | 🔥 | 热题HOT 100 | | 🗡 | 剑指offer(第二版) | 🚧 | 暂时未完成(TODO) | ## 目录 ### 基本题库 | # | 题目 | 题解 | 难度 | 标记 | 时间 | 备注 | | ----- | ---- | ---- | ---- | ---- | ---- | ---- | | A0001 | [两数之和](https://leetcode-cn.com/problems/two-sum/) | [cpp](./cpp/A0001/main.cpp) | 简单 | 🤔, 🔥, 👨‍💻 | 20/02/20 | | A0002 | [两数相加](https://leetcode-cn.com/problems/add-two-numbers/) | [cpp](./cpp/A0002/main.cpp) | 中等 | 🤔, 🐧, 🔥, 👨‍💻 | 20/02/20 | | A0003 | [无重复字符的最长子串](https://leetcode-cn.com/problems/longest-substring-without-repeating-characters) | [cpp](./cpp/A0003/main.cpp) | 中等 | 🤔, 🔥, 👨‍💻, ✅ | 20/02/20 | | A0004 | [寻找两个有序数组的中位数](https://leetcode-cn.com/problems/median-of-two-sorted-arrays/comments/) | [cpp](./cpp/A0004/main.cpp) | 困难 | ⚠️, 🤔, 🐧, 🔥, 👨‍💻 | 20/02/25 | 切分法 | | A0005 | [最长回文子串](https://leetcode-cn.com/problems/longest-palindromic-substring/) | [cpp](./cpp/A0005/main.cpp) | 中等 | 🐧, 🔥, 👨‍💻 | 20/02/23 | 整数除法取整 | | A0006 | [Z字形变换](https://leetcode-cn.com/problems/zigzag-conversion/) | [cpp](./cpp/A0006/main.cpp) | 中等 | 🤔 | 20/02/22 | | A0007 | [整数反转](https://leetcode-cn.com/problems/reverse-integer) | [cpp](./cpp/A0007/main.cpp) | 简单 | 🐧, 👨‍💻 | 20/02/21 | | A0008 | [字符串转换整数 (atoi)](https://leetcode-cn.com/problems/string-to-integer-atoi/) | [cpp](./cpp/A0008/main.cpp) | 中等 | 🐧, 👨‍💻 | 20/03/03 | 整数溢出判断 | | A0009 | [回文数](https://leetcode-cn.com/problems/palindrome-number/) | [cpp](./cpp/A0009/main.cpp) | 简单 | 🐧 | 20/02/21 | | A0010 | [正则表达式匹配](https://leetcode-cn.com/problems/regular-expression-matching/) | [cpp](./cpp/A0010/main.cpp) | 困难 | 🚧 | | | A0011 | [盛最多水的容器](https://leetcode-cn.com/problems/container-with-most-water/) | [cpp](./cpp/A0011/main.cpp) | 中等 | 🐧, 🔥, 👨‍💻, ✅ | 20/02/23 | | A0012 | [整数转罗马数字](https://leetcode-cn.com/problems/integer-to-roman/) | [cpp](./cpp/A0012/main.cpp) | 中等 | | 20/02/23 | | A0013 | [罗马数字转整数](https://leetcode-cn.com/problems/roman-to-integer/) | [cpp](./cpp/A0013/main.cpp) | 简单 | 👨‍💻 | 20/02/23 | | A0014 | [最长公共前缀](https://leetcode-cn.com/problems/longest-common-prefix/) | [cpp](./cpp/A0014/main.cpp) | 简单 | 🐧, 👨‍💻 | 20/02/23 | | A0015 | [三数之和](https://leetcode-cn.com/problems/3sum/) | [cpp](./cpp/A0015/main.cpp) | 中等 | ⚠️, 🤔, 🐧, 🔥, 👨‍💻 | 20/02/29 | | A0016 | [最接近的三数之和](https://leetcode-cn.com/problems/3sum-closest/) | [cpp](./cpp/A0016/main.cpp) | 中等 | 🐧, 🚧 | 20/02/29 | | A0017 | [电话号码的字母组合](https://leetcode-cn.com/problems/letter-combinations-of-a-phone-number/) | [cpp](./cpp/A0017/main.cpp) | 中等 | 👨‍💻 | 20/03/04 | 回溯(TODO) | | A0019 | [删除链表的倒数第N个节点](https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/) | [cpp](./cpp/A0019/main.cpp) | 中等 | 👨‍💻 | 20/03/05 | 阅读题解(TODO) | | A0020 | [有效的括号](https://leetcode-cn.com/problems/valid-parentheses/) | [cpp](./cpp/A0020/main.cpp) | 简单 | 🐧, 🔥, 👨‍💻 | 20/02/21 | | A0021 | [合并两个有序链表](https://leetcode-cn.com/problems/merge-two-sorted-lists/) | [cpp](./cpp/A0021/main.cpp) | 简单 | 🐧, 🔥, 👨‍💻, ✅ | 20/02/21 | | A0022 | [括号生成](https://leetcode-cn.com/problems/generate-parentheses/) | [cpp](./cpp/A0022/main.cpp) | 中等 | ❌, ⚠️, 🤔, ✅ | 20/04/09 | 回溯 | | A0023 | [合并K个排序链表](https://leetcode-cn.com/problems/merge-k-sorted-lists/) | [cpp](./cpp/A0023/main.cpp) | 困难 | 🐧, 🔥, 👨‍💻, ✅ | 20/02/21 | | A0024 | [两两交换链表中的节点](https://leetcode-cn.com/problems/swap-nodes-in-pairs/) | [cpp](./cpp/A0024/main.cpp) | 中等 | | 20/03/07 | | A0026 | [删除排序数组中的重复项](https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/) | [cpp](./cpp/A0026/main.cpp) | 简单 | 🐧, 👨‍💻 | 20/02/22 | | A0027 | [移除元素](https://leetcode-cn.com/problems/remove-element/) | [cpp](./cpp/A0027/main.cpp) | 简单 | | 20/03/01 | 双指针法 | | A0028 | [实现 strStr()](https://leetcode-cn.com/problems/implement-strstr/) | [cpp](./cpp/A0028/main.cpp) | 简单 | 👨‍💻 | | 字符串匹配 | | A0031 | [下一个排列](https://leetcode-cn.com/problems/next-permutation/) | [cpp](./cpp/A0031/main.cpp) | 中等 | 🚧, ✅ | 20/05/14 | STL | | A0033 | [搜索旋转排序数组](https://leetcode-cn.com/problems/search-in-rotated-sorted-array/) | [cpp](./cpp/A0033/main.cpp) | 中等 | 🐧, 🔥, 👨‍💻, ✅ | 20/03/01 | | A0034 | [在排序数组中查找元素的第一个和最后一个位置](https://leetcode-cn.com/problems/find-first-and-last-position-of-element-in-sorted-array/) | [cpp](./cpp/A0034/main.cpp) | 中等 | 🤔, 👨‍💻 | 20/03/06 | 二分搜索改进 | | A0035 | [搜索插入位置](https://leetcode-cn.com/problems/search-insert-position/) | [cpp](./cpp/A0035/main.cpp) | 简单 | | 20/03/29 | 二分搜索改进, STL | | A0036 | [有效的数独](https://leetcode-cn.com/problems/valid-sudoku/) | [cpp](./cpp/A0036/main.cpp) | 中等 | 🤔, 👨‍💻 | 20/03/09 | 数组下标计算 | | A0038 | [外观数列](https://leetcode-cn.com/problems/count-and-say/) | [cpp](./cpp/A0038/main.cpp) | 简单 | | 20/03/11 | 0ms | | A0042 | [接雨水](https://leetcode-cn.com/problems/trapping-rain-water/) | [cpp](./cpp/A0042/main.cpp) | 困难 | ⚠️, 🤔, ✅ | 20/04/04 | 栈的应用 | | A0043 | [字符串相乘](https://leetcode-cn.com/problems/multiply-strings/) | [cpp](./cpp/A0043/main.cpp) | 中等 | ⚠️, 🤔, 🐧 | 20/03/01 | | A0045 | [跳跃游戏 II](https://leetcode-cn.com/problems/jump-game-ii/) | [cpp](./cpp/A0045/main.cpp) | 困难 | 🤔, ⚠️, ✅ | 20/05/04 | 贪心 | | A0046 | [全排列](https://leetcode-cn.com/problems/permutations/) | [cpp](./cpp/A0046/main.cpp) | 中等 | ⚠️, 🤔, 🐧, 🔥, 👨‍💻, ✅ | 20/03/03 | 回溯算法, STL | | A0047 | [全排列 II](https://leetcode-cn.com/problems/permutations-ii/) | [cpp](./cpp/A0047/main.cpp) | 中等 | 🤔 | 20/03/03 | 回溯 & 剪枝 | | A0048 | [旋转图像](https://leetcode-cn.com/problems/rotate-image/) | [cpp](./cpp/A0048/main.cpp) | 中等 | 👨‍💻 | 20/03/09 | 数组下标计算 | | A0049 | [字母异位词分组](https://leetcode-cn.com/problems/group-anagrams/) | [cpp](./cpp/A0049/main.cpp) | 中等 | 🤔 | 20/03/15 | 哈希散列表 | | A0050 | [Pow(x, n)](https://leetcode-cn.com/problems/powx-n/) | [cpp](./cpp/A0050/main.cpp) | 中等 | 🤔, ⚠️, ✅ | 20/05/11 | 快速幂 | | A0053 | [最大子序和](https://leetcode-cn.com/problems/maximum-subarray/) | [cpp](./cpp/A0053/main.cpp) | 简单 | 🐧, 🔥, 👨‍💻, ✅ | 20/02/26 | 贪心&分治 | | A0054 | [螺旋矩阵](https://leetcode-cn.com/problems/spiral-matrix/) | [cpp](./cpp/A0054/main.cpp) | 中等 | 🐧, 👨‍💻 | 20/02/25 | | A0055 | [跳跃游戏](https://leetcode-cn.com/problems/jump-game/) | [cpp](./cpp/A0055/main.cpp) | 中等 | ❌, 🤔, ⚠️, ✅ | 20/04/18 | 贪心 | | A0058 | [最后一个单词的长度](https://leetcode-cn.com/problems/length-of-last-word/) | [cpp](./cpp/A0058/main.cpp) | 简单 | | 20/03/16 | | A0059 | [螺旋矩阵 II](https://leetcode-cn.com/problems/spiral-matrix-ii/) | [cpp](./cpp/A0059/main.cpp) | 中等 | 🐧 | 20/02/29 | | A0061 | [旋转链表](https://leetcode-cn.com/problems/rotate-list/) | [cpp](./cpp/A0061/main.cpp) | 中等 | 🐧 | 20/02/29 | | A0062 | [不同路径](https://leetcode-cn.com/problems/unique-paths/) | [cpp](./cpp/A0062/main.cpp) | 中等 | 🐧, 🔥, 👨‍💻 | 20/02/29 | | A0069 | [x 的平方根](https://leetcode-cn.com/problems/sqrtx/) | [cpp](./cpp/A0069/main.cpp) | 简单 | 🤔, 👨‍💻, ✅ | 20/03/12 | | A0070 | [爬楼梯](https://leetcode-cn.com/problems/climbing-stairs/) | [cpp](./cpp/A0070/main.cpp) | 简单 | 🐧, 🔥, 👨‍💻 | 20/02/22 | | A0072 | [编辑距离](https://leetcode-cn.com/problems/edit-distance/) | [cpp](./cpp/A0072/main.cpp) | 困难 | ✅ | 20/04/06 | 动态规划 | | A0073 | [矩阵置零](https://leetcode-cn.com/problems/set-matrix-zeroes/) | [cpp](./cpp/A0073/main.cpp) | 中等 | ⚠️, 🤔, 👨‍💻 | 20/03/06 | | A0078 | [子集](https://leetcode-cn.com/problems/subsets/) | [cpp](./cpp/A0078/main.cpp) | 中等 | 🐧, 🔥, 👨‍💻 | 20/02/26 | | A0088 | [合并两个有序数组](https://leetcode-cn.com/problems/merge-sorted-array/) | [cpp](./cpp/A0088/main.cpp) | 简单 | 🐧, 👨‍💻 | 20/02/22 | | A0089 | [格雷编码](https://leetcode-cn.com/problems/gray-code/) | [cpp](./cpp/A0089/main.cpp) | 中等 | 🤔, 🐧 | 20/02/24 | 格雷编码 | | A0094 | [二叉树的中序遍历](https://leetcode-cn.com/problems/binary-tree-inorder-traversal/) | [cpp](./cpp/A0094/main.cpp) | 中等 | 🤔, 👨‍💻 | 20/03/09 | 递归 & 迭代 | | A0098 | [验证二叉搜索树](https://leetcode-cn.com/problems/validate-binary-search-tree/) | [cpp](./cpp/A0098/main.cpp) | 中等 | 🤔, ✅ | 20/03/26 | 递归 & 迭代 | | A0100 | [相同的树](https://leetcode-cn.com/problems/same-tree/) | [cpp](./cpp/A0100/main.cpp) | 简单 | 🤔, ⭐️ | 20/03/26 | 层序遍历(两个队列), 深度优先搜索 | | A0102 | [二叉树的层序遍历](https://leetcode-cn.com/problems/binary-tree-level-order-traversal/) | [cpp](./cpp/A0102/main.cpp) | 中等 | ✅ | 20/05/13 | 层序遍历 | | A0104 | [二叉树的最大深度](https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/) | [cpp](./cpp/A0104/main.cpp) | 简单 | 🐧, 🔥, 👨‍💻 | 20/03/10 | 递归 & 迭代 | | A0111 | [二叉树的最小深度](https://leetcode-cn.com/problems/minimum-depth-of-binary-tree/) | [cpp](./cpp/A0111/main.cpp) | 简单 | | 20/02/23 | 递归 | | A0121 | [买卖股票的最佳时机](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock) | [cpp](./cpp/A0121/main.cpp) | 简单 | ✅, 🐧, 🔥, 👨‍💻 | 20/02/25 | | | A0122 | [买卖股票的最佳时机 II](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii) | [cpp](./cpp/A0122/main.cpp) | 简单 | 🐧, 👨‍💻 | 20/02/25 | | | A0124 | [二叉树中的最大路径和](https://leetcode-cn.com/problems/binary-tree-maximum-path-sum) | [cpp](./cpp/A0124/main.cpp) | 困难 | ⚠️, 🤔, 🐧, 🔥, 👨‍💻 | 20/03/01 | | | A0136 | [只出现一次的数字](https://leetcode-cn.com/problems/single-number/) | [cpp](./cpp/A0136/main.cpp) | 简单 | 🐧, 🔥, 👨‍💻, ✅ | 20/02/25 | 位异或运算 | | A0137 | [只出现一次的数字 II](https://leetcode-cn.com/problems/single-number-ii/) | [cpp](./cpp/A0137/main.cpp) | 中等 | 🤔, ⭐️ | 20/02/25 | 位运算 | | A0141 | [环形链表](https://leetcode-cn.com/problems/linked-list-cycle/) | [cpp](./cpp/A0141/main.cpp) | 简单 | 🐧, 🔥, 👨‍💻 | 20/02/25 | 快慢指针 | | A0142 | [环形链表 II](https://leetcode-cn.com/problems/linked-list-cycle-ii/) | [cpp](./cpp/A0142/main.cpp) | 中等 | 🤔, 🐧, 🔥 | 20/02/28 | 快慢指针 | | A0146 | [LRU缓存机制](https://leetcode-cn.com/problems/lru-cache/) | [cpp](./cpp/A0146/main.cpp) | 中等 | 🤔, 🐧, 🔥, 🚧, 👨‍💻 | 20/02/28 | | | A0148 | [排序链表](https://leetcode-cn.com/problems/sort-list/) | [cpp](./cpp/A0148/main.cpp) | 中等 | 🤔, 🐧, 🔥, 🚧, 👨‍💻 | 20/02/28 | | | A0151 | [翻转字符串里的单词](https://leetcode-cn.com/problems/reverse-words-in-a-string/) | [cpp](./cpp/A0151/main.cpp) | 中等 | ✅, ⭐️ | 20/04/10 | | | A0153 | [寻找旋转排序数组中的最小值](https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array) | [cpp](./cpp/A0153/main.cpp) | 中等 | ⚠️, 🤔, ⭐️ | 20/03/14 | 二分 | | A0154 | [寻找旋转排序数组中的最小值 II](https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array-ii) | [cpp](./cpp/A0154/main.cpp) | 困难 | ⚠️, 🤔, ⭐️ | 20/03/14 | 二分 | | A0155 | [最小栈](https://leetcode-cn.com/problems/min-stack/) | [cpp](./cpp/A0155/main.cpp) | 简单 | 🤔, 🐧, 🔥, 👨‍💻, ✅ | 20/02/25 | 辅助栈 | | A0160 | [相交链表](https://leetcode-cn.com/problems/intersection-of-two-linked-lists/) | [cpp](./cpp/A0160/main.cpp) | 简单 | 🐧, 🔥, 👨‍💻 | 20/02/25 | 双指针求双链表公共结点 | | A0167 | [两数之和 II - 输入有序数组](https://leetcode-cn.com/problems/two-sum-ii-input-array-is-sorted) | [cpp](./cpp/A0167/main.cpp) | 简单 | | 20/02/20 | | A0169 | [多数元素](https://leetcode-cn.com/problems/majority-element/) | [cpp](./cpp/A0169/main.cpp) | 简单 | 🤔, 🐧, 🔥, 👨‍💻 | 20/02/25 | Boyer-Moore投票法 | | A0199 | [二叉树的右视图](https://leetcode-cn.com/problems/binary-tree-right-side-view/) | [cpp](./cpp/A0199/main.cpp) | 中等 | ⚠️, 🤔, 🚧 | 20/04/22 | | | A0200 | [岛屿数量](https://leetcode-cn.com/problems/number-of-islands/) | [cpp](./cpp/A0200/main.cpp) | 中等 | ❌, ⚠️, 🤔, ✅ | 20/04/20 | DFS/BFS/并查集 | | A0202 | [快乐数](https://leetcode-cn.com/problems/happy-number/) | [cpp](./cpp/A0202/main.cpp) | 简单 | ✅ | 20/04/30 | 数学 | | A0206 | [反转链表](https://leetcode-cn.com/problems/reverse-linked-list/) | [cpp](./cpp/A0206/main.cpp) | 简单 | ✅, 🐧, 🔥, 👨‍💻 | 20/02/25 | [C++迭代](https://leetcode-cn.com/problems/reverse-linked-list/solution/c-die-dai-by-modnars/) 递归&迭代 | | A0215 | [数组中的第K个最大元素](https://leetcode-cn.com/problems/kth-largest-element-in-an-array/) | [cpp](./cpp/A0215/main.cpp) | 中等 | 🤔, 🐧, 🔥, 🚧, 👨‍💻 | 20/02/27 | | | A0217 | [存在重复元素](https://leetcode-cn.com/problems/contains-duplicate) | [cpp](./cpp/A0217/main.cpp) | 简单 | 🐧, 👨‍💻 | 20/02/23 | | | A0221 | [最大正方形](https://leetcode-cn.com/problems/maximal-square/) | [cpp](./cpp/A0221/main.cpp) | 中等 | ⚠️, 🤔, ✅ | 20/05/08 | 动态规划 | | A0225 | [用队列实现栈](https://leetcode-cn.com/problems/implement-stack-using-queues/) | [cpp](./cpp/A0225/main.cpp) | 简单 | ✅ | 20/03/01 | [题解](https://leetcode-cn.com/problems/implement-stack-using-queues/solution/c-time-0ms10000-memory-95mb509-by-modnars/) | | A0229 | [求众数 II](https://leetcode-cn.com/problems/majority-element-ii/) | [cpp](./cpp/A0229/main.cpp) | 中等 | 🤔 | 20/02/23 | Boyer-Moore投票法 | | A0230 | [二叉搜索树中第K小的元素](https://leetcode-cn.com/problems/kth-smallest-element-in-a-bst/) | [cpp](./cpp/A0230/main.cpp) | 中等 | 🤔, 🐧, 👨‍💻 | 20/02/26 | 递归&迭代 | | A0231 | [2的幂](https://leetcode-cn.com/problems/power-of-two/solution/2de-mi-by-leetcode/) | [cpp](./cpp/A0231/main.cpp) | 简单 | 🤔, 🐧 | 20/02/23 | 位运算 | | A0234 | [回文链表](https://leetcode-cn.com/problems/palindrome-linked-list/) | [cpp](./cpp/A0234/main.cpp) | 简单 | 🤔, 🔥, 👨‍💻 | 20/02/21 | | A0235 | [二叉搜索树的最近公共祖先](https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-search-tree/) | [cpp](./cpp/A0235/main.cpp) | 简单 | 🤔, 🐧 | 20/02/25 | 递归&迭代 | | A0236 | [二叉树的最近公共祖先](https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-tree/) | [cpp](./cpp/A0236/main.cpp) | 中等 | 🤔, 🐧, 🔥, 🚧, 👨‍💻, ✅ | 20/02/28 | 递归&迭代 | | A0237 | [删除链表中的节点](https://leetcode-cn.com/problems/delete-node-in-a-linked-list/) | [cpp](./cpp/A0237/main.cpp) | 简单 | ⭐️, 🐧, 👨‍💻 | 20/02/23 | | | A0238 | [除自身以外数组的乘积](https://leetcode-cn.com/problems/product-of-array-except-self/) | [cpp](./cpp/A0238/main.cpp) | 中等 | 🤔, 🐧, 🔥, 👨‍💻 | 20/02/26 | 乘积列表 | | A0260 | [只出现一次的数字 III](https://leetcode-cn.com/problems/single-number-iii/) | [cpp](./cpp/A0260/main.cpp) | 中等 | | 20/02/25 | 位运算 | | A0289 | [生命游戏](https://leetcode-cn.com/problems/game-of-life/) | [cpp](./cpp/A0289/main.cpp) | 中等 | 🤔, ✅ | 20/04/02 | 添加复合状态 | | A0292 | [Nim游戏](https://leetcode-cn.com/problems/nim-game/) | [cpp](./cpp/A0292/main.cpp) | 简单 | | 20/02/23 | | A0300 | [最长上升子序列](https://leetcode-cn.com/problems/longest-increasing-subsequence/) | [cpp](./cpp/A0300/main.cpp) | 中等 | 🤔, ✅ | 20/03/13 | 动态规划、贪心+二分 | | A0319 | [灯泡开关](https://leetcode-cn.com/problems/bulb-switcher/) | [cpp](./cpp/A0319/main.cpp) | 中等 | 🤔, ✅ | 20/03/11 | 思维 | | A0322 | [零钱兑换](https://leetcode-cn.com/problems/coin-change/) | [cpp](./cpp/A0322/main.cpp) | 中等 | ⚠️, 🤔, ✅ | 20/03/08 | 动态规划 | | A0344 | [反转字符串](https://leetcode-cn.com/problems/reverse-string/) | [cpp](./cpp/A0344/main.cpp) | 简单 | 🐧, 👨‍💻 | 20/02/23 | | A0365 | [水壶问题](https://leetcode-cn.com/problems/water-and-jug-problem/) | [cpp](./cpp/A0365/main.cpp) | 中等 | ⚠️, 🤔, ✅ | 20/03/21 | | A0409 | [最长回文串](https://leetcode-cn.com/problems/longest-palindrome/) | [cpp](./cpp/A0409/main.cpp) | 简单 | | 20/03/19 | | A0460 | [LFU缓存](https://leetcode-cn.com/problems/lfu-cache/) | [cpp](./cpp/A0460/main.cpp) | 困难 | ⚠️, 🤔, 🚧, ✅ | | | A0466 | [统计重复个数](https://leetcode-cn.com/problems/count-the-repetitions/) | [cpp](./cpp/A0466/main.cpp) | 困难 | 🚧, ⚠️, 🤔, ✅ | 20/04/19 | | A0540 | [有序数组中的单一元素](https://leetcode-cn.com/problems/single-element-in-a-sorted-array/) | [cpp](./cpp/A0540/main.cpp) | 中等 | | 20/03/06 | | A0543 | [二叉树的直径](https://leetcode-cn.com/problems/diameter-of-binary-tree/) | [cpp](./cpp/A0543/main.cpp) | 简单 | 🤔, ✅ | 20/03/10 | | A0557 | [反转字符串中的单词 III](https://leetcode-cn.com/problems/reverse-words-in-a-string-iii/) | [cpp](./cpp/A0557/main.cpp) | 简单 | 🐧 | 20/02/23 | | A0572 | [另一个树的子树](https://leetcode-cn.com/problems/subtree-of-another-tree/) | [cpp](./cpp/A0572/main.cpp) | 简单 | ⚠️, 🤔, ✅ | 20/05/07 | | A0695 | [岛屿的最大面积](https://leetcode-cn.com/problems/max-area-of-island/) | [cpp](./cpp/A0557/main.cpp) | 中等 | ✅ | 20/03/15 | 深度优先搜索 | | A0820 | [单词的压缩编码](https://leetcode-cn.com/problems/short-encoding-of-words/) | [cpp](./cpp/A0876/main.cpp) | 简单 | ⚠️, ❌, 🤔, ✅ | 20/03/28 | Trie树 | | A0876 | [链表的中间结点](https://leetcode-cn.com/problems/middle-of-the-linked-list/) | [cpp](./cpp/A0876/main.cpp) | 简单 | ✅ | 20/03/23 | 快慢指针 | | A0887 | [鸡蛋掉落](https://leetcode-cn.com/problems/super-egg-drop/) | [cpp](./cpp/A0887/main.cpp) | 困难 | 🚧, ⚠️, 🤔, ✅ | 20/04/11 | | | A0892 | [三维形体的表面积](https://leetcode-cn.com/problems/surface-area-of-3d-shapes/) | [cpp](./cpp/A0892/main.cpp) | 简单 | 🤔, ⭐️, ✅ | 20/03/25 | [题解](https://leetcode-cn.com/problems/surface-area-of-3d-shapes/solution/ji-suan-quan-bu-zhu-ti-mian-ji-zai-jian-qu-xiang-l/) | | A0912 | [排序数组](https://leetcode-cn.com/problems/sort-an-array/) | [cpp](./cpp/A0912/main.cpp) | 中等 | ⭐️, ✅ | 20/03/31 | | A0914 | [卡牌分组](https://leetcode-cn.com/problems/x-of-a-kind-in-a-deck-of-cards/) | [cpp](./cpp/A0914/main.cpp) | 简单 | ✅ | 20/03/27 | | A0945 | [使数组唯一的最小增量](https://leetcode-cn.com/problems/minimum-increment-to-make-array-unique/) | [cpp](./cpp/A0945/main.cpp) | 中等 | ✅ | 20/03/22 | | A0977 | [有序数组的平方](https://leetcode-cn.com/problems/squares-of-a-sorted-array/) | [cpp](./cpp/A0977/main.cpp) | 简单 | | 20/02/22 | | A0983 | [最低票价](https://leetcode-cn.com/problems/minimum-cost-for-tickets/) | [cpp](./cpp/A0983/main.cpp) | 中等 | ⚠️, 🚧, 🤔, ✅ | 20/05/06 | 动态规划 | | A0994 | [腐烂的橘子](https://leetcode-cn.com/problems/rotting-oranges/) | [cpp](./cpp/A0994/main.cpp) | 简单 | ⚠️, 🤔, ✅ | 20/03/04 | BFS, [官方题解](https://leetcode-cn.com/problems/rotting-oranges/solution/fu-lan-de-ju-zi-by-leetcode-solution/) | | A0999 | [车的可用捕获量](https://leetcode-cn.com/problems/available-captures-for-rook/) | [cpp](./cpp/A0999/main.cpp) | 简单 | ✅ | 20/03/26 | | | A1013 | [将数组分成和相等的三个部分](https://leetcode-cn.com/problems/partition-array-into-three-parts-with-equal-sum/) | [cpp](./cpp/A1013/main.cpp) | 简单 | 🤔, ✅ | 20/03/11 | | | A1071 | [字符串的最大公因子](https://leetcode-cn.com/problems/greatest-common-divisor-of-strings/) | [cpp](./cpp/A1071/main.cpp) | 简单 | 🤔, ✅ | 20/03/12 | GCD | | A1095 | [山脉数组中查找目标值](https://leetcode-cn.com/problems/find-in-mountain-array/) | [cpp](./cpp/A1095/main.cpp) | 困难 | 🚧, ⚠️, 🤔, ✅ | 20/04/29 | | | A1103 | [分糖果 II](https://leetcode-cn.com/problems/distribute-candies-to-people/) | [cpp](./cpp/A1103/main.cpp) | 简单 | ✅ | 20/03/05 | | | A1111 | [有效括号的嵌套深度](https://leetcode-cn.com/problems/maximum-nesting-depth-of-two-valid-parentheses-strings/) | [cpp](./cpp/A1111/main.cpp) | 中等 | ✅ | 20/04/01 | 模拟栈 | | A1160 | [拼写单词](https://leetcode-cn.com/problems/find-words-that-can-be-formed-by-characters/) | [cpp](./cpp/A1160/main.cpp) | 简单 | ✅ | 20/03/17 | | | A1162 | [地图分析](https://leetcode-cn.com/problems/as-far-from-land-as-possible/) | [cpp](./cpp/A1162/main.cpp) | 中等 | ✅ | 20/03/29 | 多源BFS | | A1248 | [统计「优美子数组」](https://leetcode-cn.com/problems/count-number-of-nice-subarrays/) | [cpp](./cpp/A1248/main.cpp) | 中等 | ❌, 🤔, ⚠️, ✅ | 20/04/21 | | ### 面试 | # | 题目 | 题解 | 难度 | 标记 | 时间 | 笔记 | | ----- | ---- | ---- | ---- | ---- | ---- | ---- | | B0003 | [数组中重复的数字](https://leetcode-cn.com/problems/shu-zu-zhong-zhong-fu-de-shu-zi-lcof/) | [cpp](./cpp/B0003/main.cpp) | 简单 | 🗡 | 20/03/10 | | | B0004 | [二维数组中的查找](https://leetcode-cn.com/problems/er-wei-shu-zu-zhong-de-cha-zhao-lcof/) | [cpp](./cpp/B0004/main.cpp) | 简单 | 🤔, ⭐️, 🗡 | 20/03/10 | | | B0005 | [替换空格](https://leetcode-cn.com/problems/ti-huan-kong-ge-lcof/) | [cpp](./cpp/B0005/main.cpp) | 简单 | 🤔 | 20/03/10 | string.replace | | B0006 | [从尾到头打印链表](https://leetcode-cn.com/problems/cong-wei-dao-tou-da-yin-lian-biao-lcof/) | [cpp](./cpp/B0006/main.cpp) | 简单 | ⭐️, 🗡 | 20/03/13 | 多方法求解 | | B0007 | [重建二叉树](https://leetcode-cn.com/problems/zhong-jian-er-cha-shu-lcof/) | [cpp](./cpp/B0007/main.cpp) | 中等 | 🚧, 🗡 | | 二叉树 | | B0009 | [用两个栈实现队列](https://leetcode-cn.com/problems/yong-liang-ge-zhan-shi-xian-dui-lie-lcof/) | [cpp](./cpp/B0009/main.cpp) | 简单 | 🗡 | 20/03/13 | | | B0010.1 | [I. 斐波那契数列](https://leetcode-cn.com/problems/fei-bo-na-qi-shu-lie-lcof/) | [cpp](./cpp/B0010.1/main.cpp) | 简单 | 🗡 | 20/03/13 | | | B0010.2 | [II. 青蛙跳台阶问题](https://leetcode-cn.com/problems/qing-wa-tiao-tai-jie-wen-ti-lcof/) | [cpp](./cpp/B0010.2/main.cpp) | 简单 | 🗡 | 20/03/14 | | | B0011 | [旋转数组的最小数字](https://leetcode-cn.com/problems/xuan-zhuan-shu-zu-de-zui-xiao-shu-zi-lcof/) | [cpp](.cpp/B0011/main.cpp) | 简单 | 🗡, 🤔, ⭐️ | 20/03/14 | 二分 | | B0013 | [机器人的运动范围](https://leetcode-cn.com/problems/ji-qi-ren-de-yun-dong-fan-wei-lcof/) | [cpp](.cpp/B0013/main.cpp) | 中等 | ❌, 🚧, ⚠️, 🤔, ✅ | 20/04/08 | BFS | | B0015 | [二进制中1的个数](https://leetcode-cn.com/problems/er-jin-zhi-zhong-1de-ge-shu-lcof/) | [cpp](.cpp/B0015/main.cpp) | 简单 | 🗡 | 20/03/24 | 位运算 | | B0017 | [打印从1到最大的n位数](https://leetcode-cn.com/problems/da-yin-cong-1dao-zui-da-de-nwei-shu-lcof/) | [cpp](.cpp/B0017/main.cpp) | 简单 | 🗡 | 20/03/24 | | | B0021 | [调整数组顺序使奇数位于偶数前面](https://leetcode-cn.com/problems/diao-zheng-shu-zu-shun-xu-shi-qi-shu-wei-yu-ou-shu-qian-mian-lcof/) | [cpp](.cpp/B0021/main.cpp) | 简单 | 🗡 | 20/03/28 | | | B0022 | [链表中倒数第k个节点](https://leetcode-cn.com/problems/lian-biao-zhong-dao-shu-di-kge-jie-dian-lcof/submissions/) | [cpp](.cpp/B0022/main.cpp) | 简单 | 🗡 | 20/03/29 | 快慢指针 | | B0024 | [反转链表](https://leetcode-cn.com/problems/fan-zhuan-lian-biao-lcof/) | [cpp](.cpp/B0024/main.cpp) | 简单 | ⭐️, 🗡 | 20/03/29 | | | B0025 | [合并两个有序链表](https://leetcode-cn.com/problems/he-bing-liang-ge-pai-xu-de-lian-biao-lcof/) | [cpp](.cpp/B0025/main.cpp) | 简单 | 🗡 | 20/03/24 | | | B0030 | [包含min函数的栈](https://leetcode-cn.com/problems/bao-han-minhan-shu-de-zhan-lcof/) | [cpp](.cpp/B0030/main.cpp) | 简单 | 🗡 | 20/03/29 | 辅助栈 | | B0039 | [数组中出现次数超过一半的数字](https://leetcode-cn.com/problems/shu-zu-zhong-chu-xian-ci-shu-chao-guo-yi-ban-de-shu-zi-lcof/) | [cpp](.cpp/B0039/main.cpp) | 简单 | 🗡 | 20/03/29 | Boyer-Moore投票法 | | B0040 | [最小的k个数](https://leetcode-cn.com/problems/zui-xiao-de-kge-shu-lcof/) | [cpp](./cpp/B0040/main.cpp) | 简单 | ⚠️, 🤔, ✅, 🗡 | 20/03/20 | 排序、堆排序、快排思想 | | B0049 | [丑数](https://leetcode-cn.com/problems/chou-shu-lcof/) | [cpp](./cpp/B0049/main.cpp) | 中等 | ⚠️, 🤔, 🗡 | 20/03/22 | 动态规划 | | B0051 | [数组中的逆序对](https://leetcode-cn.com/problems/shu-zu-zhong-de-ni-xu-dui-lcof/) | [cpp](./cpp/B0051/main.cpp) | 困难 | ❌, 🚧, ⚠️, 🤔, ✅ | 20/04/22 | 归并思想 | | B0057 | [II. 和为s的连续正数序列](https://leetcode-cn.com/problems/he-wei-sde-lian-xu-zheng-shu-xu-lie-lcof/) | [cpp](./cpp/B0057/main.cpp) | 简单 | ❌, 🤔, ✅ | 20/03/06 | [双指针](https://leetcode-cn.com/problems/he-wei-sde-lian-xu-zheng-shu-xu-lie-lcof/solution/mian-shi-ti-57-ii-he-wei-sde-lian-xu-zheng-shu-x-2/) | | B0059 | [II. 队列的最大值](https://leetcode-cn.com/problems/dui-lie-de-zui-da-zhi-lcof/) | [cpp](./cpp/B0059/main.cpp) | 中等 | 🤔, ✅ | 20/03/07 | [辅助双端队列](https://leetcode-cn.com/problems/dui-lie-de-zui-da-zhi-lcof/solution/mian-shi-ti-59-ii-dui-lie-de-zui-da-zhi-by-leetcod/) | | B0062 | [圆圈中最后剩下的数字](https://leetcode-cn.com/problems/yuan-quan-zhong-zui-hou-sheng-xia-de-shu-zi-lcof/) | [cpp](./cpp/B0062/main.cpp) | 简单 | ⚠️, 🤔, ✅ | 20/03/30 | 约瑟夫环 | | B01.06 | [字符串压缩](https://leetcode-cn.com/problems/compress-string-lcci/) | [cpp](./cpp/B01.06/main.cpp) | 简单 | ✅ | 20/03/16 | | | B01.07 | [旋转矩阵](https://leetcode-cn.com/problems/rotate-matrix-lcci/) | [cpp](./cpp/B01.07/main.cpp) | 中等 | ✅ | 20/04/07 | | | B08.11 | [硬币](https://leetcode-cn.com/problems/coin-lcci/) | [cpp](./cpp/B08.11/main.cpp) | 中等 | ❌, 🚧, ⚠️, 🤔, ✅ | 20/04/22 | 动态规划/数学 | | B10.01 | [合并排序的数组](https://leetcode-cn.com/problems/sorted-merge-lcci/) | [cpp](./cpp/B10.01/main.cpp) | 简单 | ✅ | 20/03/03 | [双指针(从后向前)](https://leetcode-cn.com/problems/sorted-merge-lcci/solution/shuang-zhi-zhen-cong-hou-xiang-qian-by-modnars/) | | B16.03 | [交点](https://leetcode-cn.com/problems/intersection-lcci/) | [cpp](./cpp/B16.03/main.cpp) | 困难 | 🚧, ⚠️, 🤔, ✅ | 20/04/12 | | | B17.16 | [按摩师](https://leetcode-cn.com/problems/the-masseuse-lcci/) | [cpp](./cpp/B17.16/main.cpp) | 简单 | 🤔, ✅ | 20/03/24 | [动态规划](https://leetcode-cn.com/problems/the-masseuse-lcci/solution/an-mo-shi-by-leetcode-solution/) | | B56.01 | [数组中数字出现的次数](https://leetcode-cn.com/problems/shu-zu-zhong-shu-zi-chu-xian-de-ci-shu-lcof/) | [cpp](./cpp/B56.01/main.cpp) | 中等 | ✅ | 20/04/28 | 位运算 | ### 周赛 | # | 题目 | 题解 | 难度 | 标记 | 时间 | 备注 | | ----- | ---- | ---- | ---- | ---- | ---- | ---- | | C5356 | [矩阵中的幸运数](https://leetcode-cn.com/problems/lucky-numbers-in-a-matrix/) | [cpp](./contest/C180/Q1/main.cpp) | 简单 | 🎯180 | 20/03/15 | | | C5357 | [设计一个支持增量操作的栈](https://leetcode-cn.com/contest/weekly-contest-180/problems/design-a-stack-with-increment-operation/) | [cpp](./contest/C180/Q2/main.cpp) | 中等 | 🎯180 | 20/03/15 | | | C5179 | [将二叉搜索树变平衡](https://leetcode-cn.com/contest/weekly-contest-180/problems/balance-a-binary-search-tree/) | [cpp](./contest/C180/Q3/main.cpp) | 中等 | 🎯180, 🤔 | 20/03/15 | | | C5359 | [最大的团队表现值](https://leetcode-cn.com/contest/weekly-contest-180/problems/maximum-performance-of-a-team/) | [cpp](./contest/C180/Q4/main.cpp) | 困难 | 🎯180, ⚠️, 🤔 | 20/03/15 | | | C5364 | [按既定顺序创建目标数组](https://leetcode-cn.com/contest/weekly-contest-181/problems/create-target-array-in-the-given-order/) | [cpp](./contest/C181/Q1/main.cpp) | 简单 | 🎯181 | 20/03/22 | | | C5187 | [四因数](https://leetcode-cn.com/contest/weekly-contest-181/problems/create-target-array-in-the-given-order/) | [cpp](./contest/C181/Q2/main.cpp) | 中等 | 🎯181 | 20/03/22 | | | C5366 | [检查网格中是否存在有效路径](https://leetcode-cn.com/contest/weekly-contest-181/problems/check-if-there-is-a-valid-path-in-a-grid/) | [cpp](./contest/C181/Q3/main.cpp) | 中等 | 🎯181 | 20/03/22 | | | C5367 | [最长快乐前缀](https://leetcode-cn.com/problems/longest-happy-prefix/) | [cpp](./contest/C181/Q4/main.cpp) | 困难 | 🎯181, ⚠️, 🤔 | 20/03/22 | | | C5368 | [找出数组中的幸运数](https://leetcode-cn.com/contest/weekly-contest-182/problems/find-lucky-integer-in-an-array/) | [cpp](./contest/C182/Q1/main.cpp) | 简单 | 🎯182 | 20/03/29 | | | C5369 | [统计作战单位数](https://leetcode-cn.com/contest/weekly-contest-182/problems/count-number-of-teams/) | [cpp](./contest/C182/Q2/main.cpp) | 中等 | 🎯182 | 20/03/29 | 回溯 | | C5370 | [设计地铁系统](https://leetcode-cn.com/contest/weekly-contest-182/problems/design-underground-system/) | [cpp](./contest/C182/Q3/main.cpp) | 中等 | 🎯182 | 20/03/29 | | | C5371 | [找到所有好字符串](https://leetcode-cn.com/contest/weekly-contest-182/problems/find-all-good-strings/) | [cpp](./contest/C182/Q4/main.cpp) | 困难 | 🎯182, 🚧 | | | ### 经历 | # | 题目 | 题解 | 来源 | 时间 | 笔记 | | - | ---- | ---- | ---- | ---- | ---- | | 华为机试题 | [旋转N阶方阵](./experience/HUAWEI/OperatingExam/Q1/README.md) | [cpp](./experience/HUAWEI/OperatingExam/Q1/main.cpp) | 华为 | 20/03/04 | 格式化输出 | | 华为机试题 | [礼物分法](./experience/HUAWEI/OperatingExam/Q2/README.md) | [cpp](./experience/HUAWEI/OperatingExam/Q2/main.cpp) | 华为 | 20/03/04 | 回溯 | | 华为机试题 | [排版校对](./experience/HUAWEI/OperatingExam/Q3/README.md) | [cpp](./experience/HUAWEI/OperatingExam/Q3/main.cpp) | 华为 | 20/03/04 | 动态规划 | | 腾讯面试题 | [键值对排序](./experience/Tencent/README.md) | [cpp](./experience/Tencent/Q1/main.cpp) | 腾讯 | 20/03/31 | Lambda | | 腾讯面试题 | [相邻升序/相邻降序输出](./experience/Tencent/README.md) | [cpp](./experience/Tencent/Q2/main.cpp) | 腾讯 | 20/03/31 | 滑动窗口 | ## 说明         上述列表中的时间为首次在力扣提交并通过的日期,代码中的Date表示初次尝试解题的时间。对于一些标记(比如“✅”)来说,标记获取的日期可能和列表中时间不一致。针对这些不一致的情况,这些标记的具体获取时间会在源代码中标识         **Copyright 2020 Modnar.**