记录刷leetcode分析过程,希望一点点进步!
https://leetcode.com/problemset/algorithms/
按照顺序刷第一遍,记录实现思路,自己的优化方案,并研究高票大佬的思路。
序号 | 题目 | 题解 | 实现(初步思路/优化思路/高票思路) | 标签 | 完成时间 |
---|---|---|---|---|---|
0001 | Two Sum | 题解 | 实现 | 查找, 哈希表 | 2019/09/08 |
0002 | Add Two Numbers | 题解 | 实现 | 链表 | 2019/09/09 |
0003 | Longest Substring Without Repeating Characters | 题解 | 实现 | 经典字符串,查找,哈希表,双指针法 | 2019/09/10 |
0004 | Median of Two Sorted Arrays | 题解 | 实现 | 二分查找,归并排序 | 2019/09/11 |
0006 | ZigZag Conversion | 题解 | 实现 | 逻辑 | 2019/09/13 |
0007 | Reverse Integer | 题解 | 实现 | 逻辑 | 2019/09/13 |
0008 | String To Integer | 题解 | 实现 | 2019/09/14 | |
0009 | Palindrome Number | 题解 | 实现 | 双指针 | 2019/09/17 |
0010 | Regular Expression Matching | 题解 | 实现 | 动态规划 | 2019/09/17 |
0011 | Container With Most Water | 题解 | 实现 | 数学 | 2019/09/18 |
0012 | Integer To Roman | 题解 | 实现 | 2019/09/19 | |
0013 | Roman to Integer | 题解 | 实现 | 2019/09/19 | |
0014 | Longest Common Prefix | 题解 | 实现 | 2019/09/20 | |
0015 | 3 Sum | 题解 | 实现 | 双指针法 | 2019/09/21 |
0016 | 3 Sum Closest | 题解 | 实现 | 双指针法 | 2019/09/22 |
0017 | Letter Combinations of a Phone Number | 题解 | 实现 | BFS,DFS,队列,栈 | 2019/09/25 |
0018 | 4Sum | 题解 | 实现 | 双指针法 | 2019/09/28 |
0019 | Remove Nth Node From End of List | 题解 | 实现 | 链表,双指针法 | 2019/09/29 |
0020 | Valid Parentheses | 题解 | 实现 | 栈 | 2019/10/02 |
0021 | Merge Two Sorted Lists | 题解 | 实现 | 归并排序 | 2019/10/03 |
0022 | Generate Parentheses | 题解 | 实现 | 回溯算法 | 2019/10/04 |
0023 | Merge k Sorted Lists | 题解 | 实现 | 归并排序,优先级队列 | 2019/10/07 |
0024 | Swap Nodes in Pairs | 题解 | 实现 | 链表 | 2019/10/08 |
0025 | Reverse Nodes in k-Group | 题解 | 实现 | 链表 | 2019/10/09 |
0026 | Remove Duplicates from Sorted Array | 题解 | 实现 | 数组去重 | 2019/10/12 |
0027 | Remove Element | 题解 | 实现 | 数组删除操作 | 2019/10/12 |
0028 | Implement strStr() | 题解 | 实现 | 实现indexOf | 2019/10/15 |
0029 | Divide Two Integers | 题解 | 实现 | 数学,位运算 | 2019/10/20 |
0030 | Divide Two Integers | 题解 | 实现 | 哈希表,双指针 | 2019/10/27 |
0031 | Next Permutation | 题解 | 实现 | 字典序 | 2019/10/28 |
0032 | Longest Valid Parentheses | 题解 | 实现 | 栈,动态规划 | 2019/11/02 |
0033 | Search in Rotated Sorted Array | 题解 | 实现 | 二分查找 | 2019/11/03 |
0034 | Find First and Last Position of Element in Sorted Array | 题解 | 实现 | 二分查找 | 2019/11/07 |
0035 | Search Insert Position | 题解 | 实现 | 二分查找 | 2019/11/09 |
0036 | Valid Sudoku | 题解 | 实现 | 哈希表 | 2019/11/11 |
0037 | Sudoku Solver | 题解 | 实现 | 递归 | 2019/11/12 |
0038 | Count and Say | 题解 | 实现 | 水题 | 2019/11/13 |
0039 | Combination Sum | 题解 | 实现 | DP,回溯 | 2019/11/17 |
0040 | Combination Sum II | 题解 | 实现 | DP,回溯 | 2019/11/18 |
0041 | First Missing Positive | 题解 | 实现 | 数学 | 2019/11/19 |
0042 | Trapping Rain Water | 题解 | 实现 | 数学,双指针 | 2019/11/20 |
0043 | Multiply Strings | 题解 | 实现 | 大数运算 | 2019/11/21 |
0044 | Wildcard Matching | 题解 | 实现 | 动态规划,贪心算法 | 2019/11/26 |
0045 | Jump Game II | 题解 | 实现 | 贪心算法 | 2019/11/28 |
0046 | Permutations | 题解 | 实现 | 回溯 | 2019/11/29 |
0047 | Permutations II | 题解 | 实现 | 回溯 | 2019/11/30 |
0048 | Rotate Image | 题解 | 实现 | 数组,矩阵变换 | 2019/11/30 |
0049 | Group Anagrams | 题解 | 实现 | 哈希表 | 2019/12/01 |
0050 | Pow(x,n) | 题解 | 实现 | 幂运算 | 2019/12/04 |
0051 | N-Queens | 题解 | 实现 | 回溯 | 2019/12/05 |
0052 | N-Queens II | 题解 | 实现 | 回溯 | 2019/12/06 |
0053 | Maximum Subarray | 题解 | 实现 | 动态规划,分治 | 2019/12/07 |
0054 | Spiral Matrix | 题解 | 实现 | 数组遍历 | 2019/12/08 |
0055 | Jump Game | 题解 | 实现 | 贪心算法,BFS | 2019/12/08 |
0056 | Merge Intervals | 题解 | 实现 | 数组,排序 | 2019/12/09 |
0057 | Insert Interval | 题解 | 实现 | 数组,插入排序 | 2019/12/12 |
0058 | Length of Last Word | 题解 | 实现 | 循环 | 2019/12/12 |
0059 | Spiral Matrix II | 题解 | 实现 | 数组遍历 | 2019/12/14 |
0060 | Permutation Sequence | 题解 | 实现 | 全排列规律 | 2019/12/15 |
0061 | Permutation Sequence | 题解 | 实现 | 链表 | 2019/12/16 |
0062 | Unique Paths | 题解 | 实现 | DP,数学(Pascal矩阵) | 2019/12/17 |
0063 | Unique Paths II | 题解 | 实现 | DP | 2019/12/18 |
0064 | Minimum Path Sum | 题解 | 实现 | DP | 2019/12/19 |
0065 | Valid Number | 题解 | 实现 | 正则 | 2019/12/20 |
0066 | Plus One | 题解 | 实现 | 循环 | 2019/12/21 |
0067 | Add Binary | 题解 | 实现 | 进制相加 | 2019/12/22 |
0068 | Text Justification | 题解 | 实现 | 分情况讨论 | 2019/12/23 |
0069 | Sqrt(x) | 题解 | 实现 | 二分查找 | 2019/12/24 |
0070 | Climbing Stairs | 题解 | 实现 | 动态规划,fibonacci | 2019/12/25 |
0071 | Simplify Path | 题解 | 实现 | 栈,数组 | 2020/03/04 |
0072 | Edit Distance | 题解 | 实现 | DP | 2020/03/06 |
0073 | Set Matrix Zeroes | 题解 | 实现 | 数组 | 2020/03/07 |
0074 | Search a 2D Matrix | 题解 | 实现 | 二分查找 | 2020/03/08 |
0075 | Sort Colors | 题解 | 实现 | 快排(partition) | 2020/03/09 |