LeetCode 从零单刷个人笔记整理(持续更新)
github:https://github.com/ChopinXBP/LeetCode-Babel
配套博客:https://blog.csdn.net/qq_20304723/article/details/89401203
喜欢就给颗星星再走吧~
用几乎所有可行的方法进行了实现和调优,大多数题目都附上了测试用例,少数题目进行了一些升级和扩充
下面每一道刷过的LeetCode题目附上了题号(ID列)、链接(Problem列)、官网难度评价(Difficulty列),对于已经更新的博文还会附上解题博文的链接(Note列)以及该题个人评分(Score列)。
1.个人评分依据优化难度分(优化难度指的是写出考虑周全且复杂度降至最低的算法的难度,决定题目难度上限,评价基线为刷这道题的入门平均水平,满分10分,梯度为1分。
2.部分题目还未记录和评分,对于过于简单或方法重复的题目不再记录。
3.Score列说明:D为数据库类型题,S为Shell类型题,C为多线程类型题。
Easy | Medium | Hard | Total |
---|---|---|---|
146 | 184 | 42 | 372 |
Idx | ID | Problem | Note | Date | Difficulty | Score(10) |
---|---|---|---|---|---|---|
序号 | 题号 | 原题 | 笔记 | 完成时间 | 难度 | 自评(10) |
374 | 459 | 重复的子字符串 | Repeated Substring Pattern | 2020.7.8 | Easy | 6 |
373 | 455 | 分发饼干 | Assign Cookies | 2020.7.7 | Easy | 3 |
372 | 501 | 二叉搜索树中的众数 | Find Mode in Binary Search Tree | 2020.4.6 | Easy | 5 |
371 | 264 | 丑数 II | Ugly Number II | 2020.4.6 | Medium | 6 |
370 | 213 | 打家劫舍 II | House Robber II | 2020.4.6 | Medium | 7 |
369 | 402 | 移掉K位数字 | Remove K Digits | 2020.4.6 | Medium | 6 |
368 | 692 | 前K个高频单词 | Top K Frequent Words | 2020.4.6 | Medium | 5 |
367 | 113 | 路径总和 II | Path Sum II | 2020.4.6 | Medium | 3 |
366 | 63 | 不同路径 II | Unique Paths II | 2020.4.6 | Medium | 6 |
365 | 6 | Z 字形变换 | ZigZag Conversion | 2020.4.6 | Medium | 5 |
364 | 453 | 最小移动次数使数组元素相等 | Minimum Moves to Equal Array Elements | 2020.4.6 | Easy | 6 |
363 | 443 | 压缩字符串 | String Compression | 2020.4.6 | Easy | 3 |
362 | 441 | 排列硬币 | Arranging Coins | 2020.4.6 | Easy | 3 |
361 | 434 | 字符串中的单词数 | Number of Segments in a String | 2020.4.6 | Easy | 3 |
360 | 415 | 字符串相加 | Add Strings | 2020.4.6 | Easy | 3 |
359 | 414 | 第三大的数 | Third Maximum Number | 2020.4.6 | Easy | 3 |
358 | 409 | 最长回文串 | Longest Palindrome | 2020.4.6 | Easy | 3 |
357 | 405 | 数字转换为十六进制数 | Convert a Number to Hexadecimal | 2020.4.5 | Easy | 3 |
356 | 1362 | 最接近的因数 | Closest Divisors | 2020.2.23 | Medium | 5 |
355 | 1361 | 验证二叉树 | Validate Binary Tree Nodes | 2020.2.23 | Medium | 7 |
354 | 1360 | 日期之间隔几天 | Number of Days Between Two Dates | 2020.2.23 | Easy | 6 |
353 | 1358 | 包含所有三种字符的子字符串数目 | Number of Substrings Containing All Three Characters | 2020.2.22 | Medium | 5 |
352 | 1357 | 每隔n个顾客打折 | Apply Discount Every n Orders | 2020.2.22 | Medium | 3 |
351 | 1356 | 根据数字二进制下1的数目排序 | Sort Integers by The Number of 1 Bits | 2020.2.22 | Easy | 4 |
350 | 404 | 左叶子之和 | Sum of Left Leaves | 2020.2.22 | Easy | 4 |
349 | 401 | 二进制手表 | Binary Watch | 2020.1.30 | Easy | 7 |
348 | 1319 | 连通网络的操作次数 | [Number of Operations to Make Network Connected] | 2020.1.12 | Medium | 7 |
347 | 1318 | 或运算的最小翻转次数 | Minimum Flips to Make a OR b Equal to c | 2020.1.12 | Medium | 3 |
346 | 1317 | 将整数转换为两个无零整数的和 | Convert Integer to the Sum of Two No-Zero Integers | 2020.1.12 | Easy | 3 |
345 | 392 | 判断子序列 | Is Subsequence | 2020.1.10 | Easy | 3 |
344 | 389 | 找不同 | Find the Difference | 2020.1.10 | Easy | 3 |
343 | 383 | 赎金信 | Ransom Note | 2020.1.10 | Easy | 3 |
342 | 1306 | 跳跃游戏 III | Jump Game III | 2019.12.29 | Medium | 3 |
341 | 1305 | 两棵二叉搜索树中的所有元素 | All Elements in Two Binary Search Trees | 2019.12.29 | Medium | 3 |
340 | 1304 | 和为零的N个唯一整数 | Find N Unique Integers Sum up to Zero | 2019.12.29 | Easy | 3 |
339 | 342 | 4的幂 | Power of Four | 2019.12.27 | Easy | 6 |
338 | 303 | 区域和检索-数组不可变 | Range Sum Query-Immutable | 2019.12.27 | Easy | 3 |
337 | 1297 | 子串的最大出现次数 | Maximum Number of Occurrences of a Substring | 2019.12.22 | Medium | 6 |
336 | 1296 | 划分数组为连续数字的集合 | Divide Array in Sets of K Consecutive Numbers | 2019.12.22 | Medium | 5 |
335 | 1294 | 统计位数为偶数的数字 | Find Numbers with Even Number of Digits | 2019.12.22 | Easy | 2 |
334 | 299 | 猜数字游戏 | Bulls and Cows | 2019.12.19 | Easy | 3 |
333 | 290 | 单词规律 | Word Pattern | 2019.12.19 | Easy | 3 |
332 | 601 | 体育馆的人流量 | Human Traffic of Stadium | 2019.12.19 | Hard | D |
331 | 263 | 丑数 | Ugly Number | 2019.12.18 | Easy | 3 |
330 | 262 | 行程和用户 | Trips and Users | 2019.12.18 | Hard | D |
329 | 258 | 各位相加 | Add Digits | 2019.12.16 | Easy | 7 |
328 | 1292 | 元素和小于等于阈值的正方形的最大边长 | Maximum Side Length of a Square with Sum Less than or Equal to Threshold | 2019.12.15 | Medium | 8 |
327 | 1291 | 顺次数 | Sequential Digits | 2019.12.15 | Medium | 3 |
326 | 1290 | 二进制链表转整数 | Convert Binary Number in a Linked List to Integer | 2019.12.15 | Easy | 3 |
325 | 257 | 二叉树的所有路径 | Binary Tree Paths | 2019.12.11 | Easy | 3 |
324 | 185 | 部门工资前三高的所有员工 | Department Top Three Salaries | 2019.12.11 | Hard | D |
323 | 168 | Excel表列名称 | Excel Sheet Column Title | 2019.12.10 | Easy | 7 |
322 | 107 | 二叉树的层次遍历II | Binary Tree Level Order Traversal II | 2019.12.10 | Easy | 3 |
321 | 82 | 删除排序链表中的重复元素II | Remove Duplicates from Sorted List II | 2019.12.10 | Medium | 3 |
320 | 83 | 删除排序链表中的重复元素 | Remove Duplicates from Sorted List | 2019.12.10 | Easy | 3 |
319 | 58 | 最后一个单词的长度 | Length of Last Word | 2019.12.10 | Easy | 3 |
318 | 626 | 换座位 | Exchange Seats | 2019.12.10 | Medium | D |
317 | 1226 | 哲学家进餐 | The Dining Philosophers | 2019.12.9 | Medium | C |
316 | 184 | 部门工资最高的员工 | Department Highest Salary | 2019.12.9 | Medium | D |
315 | 1283 | 使结果不超过阈值的最小除数 | Find the Smallest Divisor Given a Threshold | 2019.12.8 | Medium | 5 |
314 | 1282 | 用户分组 | Group the People Given the Group Size They Belong To | 2019.12.8 | Medium | 3 |
313 | 1281 | 整数的各位积和之差 | Subtract the Product and Sum of Digits of an Integer | 2019.12.8 | Easy | 3 |
312 | 1195 | 交替打印字符串 | Fizz Buzz Multithreaded | 2019.12.4 | Medium | C |
311 | 180 | 连续出现的数字 | Consecutive Numbers | 2019.12.4 | Medium | D |
310 | 393 | UTF-8 编码验证 | UTF-8 Validation | 2019.12.4 | Medium | 4 |
309 | 35 | 搜索插入位置 | Search Insert Position | 2019.12.3 | Easy | 4 |
308 | 178 | 分数排名 | Rank Scores | 2019.12.3 | Medium | D |
307 | 432 | 全 O(1) 的数据结构 | All O`one Data Structure | 2019.12.3 | Hard | 8 |
306 | 1117 | H2O 生成 | Building H2O | 2019.12.2 | Medium | C |
305 | 177 | 第N高的薪水 | Nth Highest Salary | 2019.12.2 | Medium | D |
304 | 354 | 俄罗斯套娃信封问题 | Russian Doll Envelopes | 2019.12.2 | Hard | 10 |
303 | 1277 | 统计全为1的正方形子矩阵 | Count Square Submatrices with All Ones | 2019.12.1 | Medium | 7 |
302 | 1276 | 不浪费原料的汉堡制作方案 | Number of Burgers with No Waste of Ingredients | 2019.12.1 | Medium | 3 |
301 | 1275 | 找出井字棋的获胜者 | Find Winner on a Tic Tac Toe Game | 2019.12.1 | Easy | 3 |
300 | 1179 | 重新格式化部门表 | Reformat Department Table | 2019.11.30 | Easy | D |
299 | 120 | 三角形最小路径和 | Triangle | 2019.11.30 | Medium | 7 |
298 | 1116 | 打印零与奇偶数 | Print Zero Even Odd | 2019.11.29 | Medium | C |
297 | 627 | 交换工资 | Swap Salary | 2019.11.29 | Easy | D |
296 | 620 | 有趣的电影 | Not Boring Movies | 2019.11.29 | Easy | 3 |
295 | 60 | 第k个排列 | Permutation Sequence | 2019.11.29 | Medium | 9 |
294 | 1115 | 交替打印FooBar | Print FooBar Alternately | 2019.11.28 | Medium | C |
293 | 596 | 超过5名学生的课 | Classes More Than 5 Students | 2019.11.28 | Easy | D |
292 | 595 | 大的国家 | Big Countries | 2019.11.28 | Easy | D |
291 | 674 | 最长连续递增序列 | Longest Continuous Increasing Subsequence | 2019.11.28 | Easy | 3 |
290 | 695 | 岛屿的最大面积 | Max Area of Island | 2019.11.28 | Medium | 3 |
289 | 1114 | 按序打印 | Print in Order | 2019.11.27 | Easy | C |
288 | 197 | 上升的温度 | Rising Temperature | 2019.11.26 | Easy | D |
287 | 196 | 删除重复的电子邮箱 | Delete Duplicate Emails | 2019.11.26 | Easy | D |
286 | 194 | 转置文件 | Transpose File | 2019.11.24 | Medium | S |
285 | 183 | 从不订购的客户 | Customers Who Never Order | 2019.11.24 | Easy | D |
284 | 1268 | 搜索推荐系统 | Search Suggestions System | 2019.11.24 | Medium | 7 |
283 | 1267 | 统计参与通信的服务器 | Count Servers that Communicate | 2019.11.24 | Medium | 3 |
282 | 1266 | 访问所有点的最小时间 | Minimum Time Visiting All Points | 2019.11.24 | Easy | 3 |
281 | 192 | 统计词频 | Word Frequency | 2019.11.23 | Medium | S |
280 | 182 | 查找重复的电子邮箱 | Duplicate Emails | 2019.11.23 | Easy | D |
279 | 93 | 复原IP地址 | Restore IP Addresses | 2019.11.22 | Medium | 7 |
278 | 71 | 简化路径 | Simplify Path | 2019.11.22 | Medium | 5 |
277 | 195 | 第十行 | Tenth Line | 2019.11.22 | Easy | S |
276 | 181 | 超过经理收入的员工 | Employees Earning More Than Their Managers | 2019.11.22 | Easy | D |
275 | 567 | 字符串的排列 | Permutation in String | 2019.11.21 | Medium | 6 |
274 | 176 | 第二高的薪水 | Second Highest Salary | 2019.11.21 | Easy | D |
273 | 193 | 有效电话号码 | Valid Phone Numbers | 2019.11.21 | Easy | S |
272 | 175 | 组合两个表 | Combine Two Tables | 2019.11.20 | Easy | D |
271 | 1262 | 可被三整除的最大和 | Greatest Sum Divisible by Three | 2019.11.17 | Medium | 7 |
270 | 1261 | 在受污染的二叉树中查找元素 | Find Elements in a Contaminated Binary Tree | 2019.11.17 | Medium | 5 |
269 | 1260 | 二维网格迁移 | Shift 2D Grid | 2019.11.17 | Easy | 4 |
268 | 100 | 相同的树 | Same Tree | 2019.11.16 | Easy | 3 |
267 | 77 | 组合 | Combinations | 2019.11.15 | Medium | 8 |
266 | 37 | 解数独 | Sudoku Solver | 2019.11.14 | Hard | 7 |
265 | 52 | N皇后 II | N-Queens II | 2019.11.13 | Hard | 7 |
264 | 51 | N皇后 | N-Queens | 2019.11.13 | Hard | 7 |
263 | 887 | 鸡蛋掉落 | Super Egg Drop | 2019.11.12 | Hard | 10 |
262 | 547 | 朋友圈 | Friend Circles | 2019.11.10 | Medium | 5 |
261 | 447 | 回旋镖的数量 | Number of Boomerangs | 2019.11.10 | Easy | 4 |
260 | 18 | 四数之和 | 4Sum | 2019.11.9 | Medium | 6 |
259 | 451 | 根据字符出现频率排序 | Sort Characters By Frequency | 2019.11.9 | Medium | 3 |
258 | 345 | 反转字符串中的元音字母 | Sort Characters By Frequency | 2019.11.9 | Easy | 3 |
257 | 80 | 删除排序数组中的重复项II | Remove Duplicates from Sorted Array II | 2019.11.9 | Medium | 3 |
256 | 336 | 回文对 | Palindrome Pairs | 2019.11.8 | Hard | 9 |
255 | 421 | 数组中两个数的最大异或值 | Maximum XOR of Two Numbers in an Array | 2019.11.7 | Medium | 9 |
254 | 211 | 添加与搜索单词-数据结构设计 | Add and Search Word - Data structure design | 2019.11.7 | Medium | 6 |
253 | 648 | 单词替换 | Replace Words | 2019.11.6 | Medium | 6 |
252 | 677 | 键值映射 | Map Sum Pairs | 2019.11.5 | Medium | 6 |
251 | 559 | N叉树的最大深度 | Maximum Depth of N-ary Tree | 2019.11.4 | Easy | 3 |
250 | 429 | N叉树的层序遍历 | N-ary Tree Level Order Traversal | 2019.11.4 | Medium | 3 |
249 | 590 | N叉树的后序遍历 | N-ary Tree Postorder Traversal | 2019.11.4 | Easy | 3 |
248 | 589 | N叉树的前序遍历 | N-ary Tree Preorder Traversal | 2019.11.4 | Easy | 3 |
247 | 110 | 平衡二叉树 | Balanced Binary Tree | 2019.11.4 | Easy | 3 |
246 | 220 | 存在重复元素III | Contains Duplicate III | 2019.11.3 | Medium | 9 |
245 | 703 | 数据流中的第K大元素 | Kth Largest Element in a Stream | 2019.11.3 | Easy | 4 |
244 | 701 | 二叉搜索树中的插入操作 | Insert into a Binary Search Tree | 2019.11.1 | Medium | 4 |
243 | 450 | 删除二叉搜索树中的节点 | Delete Node in a BST | 2019.11.1 | Medium | 4 |
242 | 700 | 二叉搜索树中的搜索 | Search in a Binary Search Tree | 2019.10.31 | Easy | 3 |
241 | 173 | 二叉搜索树迭代器 | Binary Search Tree Iterator | 2019.10.31 | Medium | 6 |
240 | 117 | 填充每个节点的下一个右侧节点指针 II | Populating Next Right Pointers in Each Node II | 2019.10.31 | Medium | 5 |
239 | 112 | 路径总和 | Path Sum | 2019.10.31 | Easy | 3 |
238 | 145 | 二叉树的后序遍历 | Binary Tree Postorder Traversal | 2019.10.30 | Hard | 6 |
237 | 144 | 二叉树的前序遍历 | Binary Tree Preorder Traversal | 2019.10.30 | Medium | 6 |
236 | 410 | 分割数组的最大值 | Split Array Largest Sum | 2019.10.30 | Hard | 9 |
235 | 719 | 找出第k小的距离对 | Find K-th Smallest Pair Distance | 2019.10.29 | Hard | 10 |
234 | 154 | 寻找旋转排序数组中的最小值 II | Find Minimum in Rotated Sorted Array II | 2019.10.28 | Hard | 7 |
233 | 744 | 寻找比目标字母大的最小字母 | Find Smallest Letter Greater Than Target | 2019.10.28 | Easy | 5 |
232 | 367 | 有效的完全平方数 | Valid Perfect Square | 2019.10.28 | Easy | 5 |
231 | 658 | 找到 K 个最接近的元素 | Find K Closest Elements | 2019.10.27 | Medium | 6 |
230 | 153 | 寻找旋转排序数组中的最小值 | Find Minimum in Rotated Sorted Array | 2019.10.27 | Medium | 6 |
229 | 278 | 第一个错误的版本 | First Bad Version | 2019.10.27 | Easy | 5 |
228 | 374 | 猜数字大小 | Guess Number Higher or Lower | 2019.10.26 | Easy | 5 |
227 | 704 | 二分查找 | Binary Search | 2019.10.26 | Easy | 5 |
226 | 771 | 宝石与石头 | Jewels and Stones | 2019.10.26 | Easy | 3 |
225 | 652 | 寻找重复的子树 | Find Duplicate Subtrees | 2019.10.24 | Medium | 7 |
224 | 219 | 存在重复元素 II | Contains Duplicate II | 2019.10.24 | Easy | 3 |
223 | 599 | 两个列表的最小索引总和 | Minimum Index Sum of Two Lists | 2019.10.22 | Easy | 3 |
222 | 205 | 同构字符串 | Isomorphic Strings | 2019.10.22 | Easy | 3 |
221 | 349 | 两个数组的交集 | Intersection of Two Arrays | 2019.10.22 | Easy | 3 |
220 | 706 | 设计哈希映射 | Design HashMap | 2019.10.21 | Easy | 6 |
219 | 705 | 设计哈希集合 | Design HashSet | 2019.10.21 | Easy | 6 |
218 | 430 | 扁平化多级双向链表 | Flatten a Multilevel Doubly Linked List | 2019.10.20 | Medium | 5 |
217 | 203 | 移除链表元素 | Remove Linked List Elements | 2019.10.20 | Easy | 3 |
216 | 707 | 设计链表 | Design Linked List | 2019.10.20 | Medium | 6 |
215 | 151 | 翻转字符串里的单词 | Reverse Words in a String | 2019.10.19 | Medium | 4 |
214 | 209 | 长度最小的子数组 | Minimum Size Subarray Sum | 2019.10.19 | Medium | 4 |
213 | 485 | 最大连续1的个数 | Max Consecutive Ones | 2019.10.19 | Easy | 3 |
212 | 27 | 移除元素 | Remove Element | 2019.10.19 | Easy | 3 |
211 | 167 | 两数之和 II - 输入有序数组 | Two Sum II - Input array is sorted | 2019.10.18 | Easy | 3 |
210 | 561 | 数组拆分 I | Array Partition I | 2019.10.18 | Easy | 3 |
209 | 67 | 二进制求和 | Add Binary | 2019.10.16 | Easy | 4 |
208 | 498 | 对角线遍历 | Diagonal Traverse | 2019.10.15 | Medium | 7 |
207 | 747 | 至少是其他数字两倍的最大数 | Largest Number At Least Twice of Others | 2019.10.14 | Easy | 3 |
206 | 724 | 寻找数组的中心索引 | Find Pivot Index | 2019.10.14 | Easy | 3 |
205 | 841 | 钥匙和房间 | Keys and Rooms | 2019.10.13 | Medium | 3 |
204 | 542 | 01 矩阵 | 01 Matrix | 2019.10.12 | Medium | 7 |
203 | 733 | 图像渲染 | Flood Fill | 2019.10.12 | Easy | 3 |
202 | 232 | 用栈实现队列 | Implement Queue using Stacks | 2019.10.12 | Easy | 3 |
201 | 225 | 用队列实现栈 | Implement Stack using Queues | 2019.10.12 | Easy | 3 |
200 | 133 | 克隆图 | Clone Graph | 2019.10.10 | Medium | 5 |
199 | 752 | 打开转盘锁 | Open the Lock | 2019.10.10 | Medium | 5 |
198 | 622 | 设计循环队列 | Design Circular Queue | 2019.10.10 | Medium | 5 |
197 | 739 | 每日温度 | Daily Temperatures | 2019.10.10 | Medium | 5 |
196 | 647 | 回文子串 | Palindromic Substrings | 2019.10.9 | Medium | 7 |
195 | 621 | 任务调度器 | Task Scheduler | 2019.10.9 | Medium | 7 |
194 | 617 | 合并二叉树 | Merge Two Binary Trees | 2019.10.9 | Easy | 3 |
193 | 581 | 最短无序连续子数组 | Shortest Unsorted Continuous Subarray | 2019.10.8 | Easy | 7 |
192 | 560 | 和为K的子数组 | Subarray Sum Equals K | 2019.10.8 | Medium | 7 |
191 | 543 | 二叉树的直径 | Diameter of Binary Tree | 2019.10.7 | Easy | 3 |
190 | 538 | 把二叉搜索树转换为累加树 | Convert BST to Greater Tree | 2019.10.7 | Easy | 3 |
189 | 494 | 目标和 | Target Sum | 2019.10.7 | Medium | 8 |
188 | 461 | 汉明距离 | Hamming Distance | 2019.10.5 | Easy | 5 |
187 | 448 | 找到所有数组中消失的数字 | Find All Numbers Disappeared in an Array | 2019.10.5 | Easy | 5 |
186 | 438 | 找到字符串中所有字母异位词 | Find All Anagrams in a String | 2019.10.5 | Medium | 5 |
185 | 437 | 路径总和 III | Path Sum III | 2019.10.5 | Easy | 6 |
184 | 416 | 分割等和子集 | Partition Equal Subset Sum | 2019.10.4 | Medium | 6 |
183 | 406 | 根据身高重建队列 | Queue Reconstruction by Height | 2019.10.3 | Medium | 5 |
182 | 399 | 除法求值 | Evaluate Division | 2019.10.3 | Medium | 5 |
181 | 394 | 字符串解码 | Decode String | 2019.10.3 | Medium | 6 |
180 | 338 | 比特位计数 | Counting Bits | 2019.10.3 | Medium | 6 |
179 | 337 | 打家劫舍 III | House Robber III | 2019.10.2 | Medium | 8 |
178 | 309 | 最佳买卖股票时机含冷冻期 | Best Time to Buy and Sell Stock with Cooldown | 2019.10.1 | Medium | 7 |
177 | 301 | 删除无效的括号 | Remove Invalid Parentheses | 2019.9.30 | Hard | 8 |
176 | 226 | 翻转二叉树 | Invert Binary Tree | 2019.9.30 | Easy | 3 |
175 | 221 | 最大正方形 | Maximal Square | 2019.9.30 | Medium | 9 |
174 | 114 | 二叉树展开为链表 | Flatten Binary Tree to Linked List | 2019.9.29 | Medium | 5 |
173 | 85 | 最大矩形 | Maximal Rectangle | 2019.9.29 | Hard | 10 |
172 | 72 | 编辑距离 | Edit Distance | 2019.9.29 | Hard | 10 |
171 | 64 | 最小路径和 | Minimum Path Sum | 2019.9.28 | Medium | 7 |
170 | 39 | 组合总和 | Combination Sum | 2019.9.28 | Medium | 7 |
169 | 32 | 最长有效括号 | Longest Valid Parentheses | 2019.9.25 | Hard | 10 |
168 | 31 | 下一个排列 | Next Permutation | 2019.9.24 | Medium | 6 |
167 | 454 | 四数相加 II | 4Sum II | 2019.9.23 | Medium | 4 |
166 | 412 | Fizz Buzz | Fizz Buzz | 2019.9.20 | Easy | 1 |
165 | 395 | 至少有K个重复字符的最长子串 | Longest Substring with At Least K Repeating Characters | 2019.9.20 | Medium | 8 |
164 | 387 | 字符串中的第一个唯一字符 | First Unique Character in a String | 2019.9.19 | Easy | 3 |
163 | 384 | 打乱数组 | Shuffle an Array | 2019.9.19 | Medium | 6 |
162 | 381 | O(1) 时间插入、删除和获取随机元素 - 允许重复 | Insert Delete GetRandom O(1) - Duplicates allowed | 2019.9.18 | Hard | 7 |
161 | 380 | 常数时间插入、删除和获取随机元素 | Insert Delete GetRandom O(1) | 2019.9.18 | Medium | 6 |
160 | 378 | 有序矩阵中第K小的元素 | Kth Smallest Element in a Sorted Matrix | 2019.9.17 | Medium | 6 |
159 | 371 | 两整数之和 | Sum of Two Integers | 2019.9.16 | Easy | 6 |
158 | 350 | 两个数组的交集 II | Intersection of Two Arrays II | 2019.9.14 | Easy | 4 |
157 | 347 | 前K个高频元素 | Top K Frequent Elements | 2019.9.14 | Medium | 4 |
156 | 341 | 扁平化嵌套列表迭代器 | Flatten Nested List Iterator | 2019.9.14 | Medium | 6 |
155 | 329 | 矩阵中的最长递增路径 | Longest Increasing Path in a Matrix | 2019.9.12 | Hard | 10 |
154 | 334 | 递增的三元子序列 | Increasing Triplet Subsequence | 2019.9.10 | Medium | 6 |
153 | 328 | 奇偶链表 | [Odd Even Linked List] | 2019.9.9 | Medium | 3 |
152 | 326 | 3的幂 | Power of Three | 2019.9.9 | Easy | 6 |
151 | 324 | 摆动排序 II | Wiggle Sort II | 2019.8.21 | Medium | 6 |
150 | 315 | 计算右侧小于当前元素的个数 | Count of Smaller Numbers After Self | 2019.8.20 | Hard | 7 |
149 | 300 | 最长上升子序列 | Longest Increasing Subsequence | 2019.8.19 | Medium | 9 |
148 | 297 | 二叉树的序列化与反序列化 | Serialize and Deserialize Binary Tree | 2019.8.18 | Hard | 5 |
147 | 295 | 数据流的中位数 | Find Median from Data Stream | 2019.8.17 | Hard | 6 |
146 | 289 | 生命游戏 | Game of Life | 2019.8.16 | Medium | 3 |
145 | 287 | 寻找重复数 | Find the Duplicate Number | 2019.8.15 | Medium | 5 |
144 | 283 | 移动零 | Move Zeroes | 2019.8.13 | Easy | 3 |
143 | 279 | 完全平方数 | Perfect Squares | 2019.8.12 | Medium | 6 |
142 | 268 | 缺失数字 | Missing Number | 2019.8.11 | Easy | 5 |
141 | 242 | 有效的字母异位词 | [Valid Anagram] | 2019.8.10 | Easy | 3 |
140 | 240 | 搜索二维矩阵 II | Search a 2D Matrix II | 2019.8.9 | Medium | 5 |
139 | 239 | 滑动窗口最大值 | Sliding Window Maximum | 2019.8.7 | Hard | 9 |
138 | 234 | 回文链表 | Palindrome Linked List | 2019.8.7 | Easy | 3 |
137 | 227 | 基本计算器 II | Basic Calculator II | 2019.8.6 | Medium | 6 |
136 | 218 | 天际线问题 | The Skyline Problem | 2019.8.5 | Hard | 10 |
135 | 212 | 单词搜索 II | Word Search II | 2019.8.2 | Hard | 8 |
134 | 210 | 课程表 II | Course Schedule II | 2019.8.1 | Medium | 10 |
133 | 207 | 课程表 | Course Schedule | 2019.8.1 | Medium | 9 |
132 | 204 | 计数质数 | Count Primes | 2019.8.1 | Easy | 6 |
131 | 202 | 快乐数 | Happy Number | 2019.8.1 | Easy | 6 |
130 | 200 | 岛屿数量 | Number of Islands | 2019.7.31 | Medium | 7 |
129 | 198 | 打家劫舍 | House Robber | 2019.7.31 | Easy | 5 |
128 | 191 | 位1的个数 | Number of 1 Bits | 2019.7.30 | Easy | 6 |
127 | 190 | 颠倒二进制位 | [Reverse Bits] | 2019.7.30 | Easy | 3 |
126 | 189 | 旋转数组 | Rotate Array | 2019.7.30 | Easy | 5 |
125 | 179 | 最大数 | Largest Number | 2019.7.29 | Medium | 3 |
124 | 172 | 阶乘后的零 | Factorial Trailing Zeroes | 2019.7.29 | Easy | 6 |
123 | 171 | Excel表列序号 | Excel Sheet Column Number | 2019.7.29 | Easy | 3 |
122 | 166 | 分数到小数 | Fraction to Recurring Decimal | 2019.7.28 | Medium | 6 |
121 | 162 | 寻找峰值 | Find Peak Element | 2019.7.27 | Medium | 6 |
120 | 152 | 乘积最大子序列 | Maximum Product Subarray | 2019.7.26 | Medium | 7 |
119 | 140 | 单词拆分 II | Word Break II | 2019.7.25 | Hard | 9 |
118 | 95 | 不同的二叉搜索树 II | Unique Binary Search Trees II | 2019.7.24 | Medium | 9 |
117 | 96 | 不同的二叉搜索树 | Unique Binary Search Trees | 2019.7.24 | Medium | 7 |
116 | 138 | 复制带随机指针的链表 | Copy List with Random Pointer | 2019.7.23 | Medium | 6 |
115 | 779 | 第K个语法符号 | K-th Symbol in Grammar | 2019.7.23 | Medium | 7 |
114 | 509 | 斐波那契数 | Fibonacci Number | 2019.7.22 | Easy | 3 |
113 | 119 | 杨辉三角 II | Pascal's Triangle II | 2019.7.22 | Easy | 3 |
112 | 24 | 两两交换链表中的节点 | Swap Nodes in Pairs | 2019.7.22 | Medium | 3 |
111 | 134 | 加油站 | Gas Station | 2019.7.22 | Medium | 6 |
110 | 131 | 分割回文串 | Palindrome Partitioning | 2019.7.19 | Medium | 8 |
109 | 130 | 被围绕的区域 | Surrounded Regions | 2019.7.17 | Medium | 6 |
108 | 128 | 最长连续序列 | Longest Consecutive Sequence | 2019.6.19 | Hard | 7 |
107 | 127 | 单词接龙 | Word Ladder | 2019.6.18 | Medium | 7 |
106 | 125 | 验证回文串 | Valid Palindrome | 2019.6.17 | Easy | 3 |
105 | 118 | 杨辉三角 | Pascal's Triangle | 2019.6.16 | Easy | 3 |
104 | 116 | 填充每个节点的下一个右侧节点指针 | Populating Next Right Pointers in Each Node | 2019.6.14 | Medium | 5 |
103 | 912 | 排序数组 | Sort an Array | 2019.6.9 | Medium | 7 |
102 | 147 | 对链表进行插入排序 | Insertion Sort List | 2019.6.8 | Medium | 6 |
101 | 109 | 有序链表转换二叉搜索树 | Convert Sorted List to Binary Search Tree | 2019.6.7 | Medium | 7 |
100 | 108 | 将有序数组转换为二叉搜索树 | Convert Sorted Array to Binary Search Tree | 2019.6.7 | Easy | 6 |
99 | 319 | 灯泡开关 | Bulb Switcher | 2019.6.7 | Medium | 5 |
98 | 106 | 从中序与后序遍历序列构造二叉树 | Construct Binary Tree from Inorder and Postorder Traversal | 2019.6.6 | Medium | 6 |
97 | 105 | 从前序与中序遍历序列构造二叉树 | Construct Binary Tree from Preorder and Inorder Traversal | 2019.6.6 | Medium | 6 |
96 | 139 | 单词拆分 | Word Break | 2019.6.3 | Medium | 7 |
95 | 103 | 二叉树的锯齿形层次遍历 | Binary Tree Zigzag Level Order Traversal | 2019.5.31 | Medium | 6 |
94 | 102 | 二叉树的层次遍历 | Binary Tree Level Order Traversal | 2019.5.31 | Medium | 5 |
93 | 101 | 对称二叉树 | Symmetric Tree | 2019.5.31 | Easy | 6 |
92 | 98 | 验证二叉搜索树 | Validate Binary Search Tree | 2019.5.31 | Medium | 6 |
91 | 94 | 二叉树的中序遍历 | Binary Tree Inorder Traversal | 2019.5.31 | Medium | 6 |
90 | 91 | 解码方法 | Decode Ways | 2019.5.31 | Medium | 7 |
89 | 84 | 柱状图中最大的矩形 | Largest Rectangle in Histogram | 2019.5.30 | Hard | 8 |
88 | 79 | 单词搜索 | Word Search | 2019.5.29 | Medium | 5 |
87 | 76 | 最小覆盖子串 | Minimum Window Substring | 2019.5.28 | Hard | 8 |
86 | 75 | 颜色分类 | Sort Colors | 2019.5.26 | Medium | 6 |
85 | 73 | 矩阵置零 | Set Matrix Zeroes | 2019.5.26 | Medium | 6 |
84 | 69 | x 的平方根 | Sqrt(x) | 2019.5.24 | Easy | 6 |
83 | 66 | 加一 | Plus One | 2019.5.24 | Easy | 3 |
82 | 56 | 合并区间 | Merge Intervals | 2019.5.24 | Medium | 6 |
81 | 55 | 跳跃游戏 | Jump Game | 2019.5.20 | Medium | 6 |
80 | 50 | Pow(x, n) | Pow(x, n) | 2019.5.13 | Medium | 5 |
79 | 49 | 字母异位词分组 | Group Anagrams | 2019.5.13 | Medium | 5 |
78 | 48 | 旋转图像 | Rotate Image | 2019.5.8 | Medium | 3 |
77 | 44 | 通配符匹配 | Wildcard Matching | 2019.5.6 | Hard | 10 |
76 | 42 | 接雨水 | Trapping Rain Water | 2019.5.6 | Hard | 8 |
75 | 41 | 缺失的第一个正数 | First Missing Positive | 2019.5.6 | Hard | 6 |
74 | 38 | 报数 | Count and Say | 2019.5.3 | Easy | 3 |
73 | 36 | 有效的数独 | Valid Sudoku | 2019.4.30 | Medium | 3 |
72 | 34 | 在排序数组中查找元素的第一个和最后一个位置 | Find First and Last Position of Element in Sorted Array | 2019.4.28 | Medium | 4 |
71 | 29 | 两数相除 | Divide Two Integers | 2019.4.28 | Medium | 4 |
70 | 28 | 实现strStr() | Implement strStr() | 2019.4.25 | Easy | 3 |
69 | 20 | 括号生成 | Generate Parentheses | 2019.4.24 | Medium | 6 |
68 | 19 | 删除链表的倒数第N个节点 | Remove Nth Node From End of List | 2019.4.24 | Medium | 3 |
67 | 17 | 电话号码的字母组合 | Letter Combinations of a Phone Number | 2019.4.24 | Medium | 3 |
66 | 13 | 罗马数字转整数 | Roman to Integer | 2019.4.23 | Easy | 3 |
65 | 12 | 整数转罗马数字 | Integer to Roman | 2019.4.23 | Medium | 3 |
64 | 10 | 正则表达式匹配 | Regular Expression Matching | 2019.4.19 | Hard | 10 |
63 | 3 | 无重复字符的最长子串 | Longest Substring Without Repeating Characters | 2019.4.18 | Medium | 5 |
62 | 1 | 两数之和 | Two Sum | 2019.4.16 | Easy | 4 |
61 | 557 | 反转字符串中的单词 III | Reverse Words in a String III | 2019.4.15 | Easy | 3 |
60 | 344 | 反转字符串 | Reverse String | 2019.4.15 | Easy | 3 |
59 | 292 | Nim游戏 | Nim Game | 2019.4.15 | Easy | 3 |
58 | 238 | 除自身以外数组的乘积 | Product of Array Except Self | 2019.4.15 | Medium | 5 |
57 | 237 | 删除链表中的节点 | Delete Node in a Linked List | 2019.4.14 | Easy | 3 |
56 | 236 | 二叉树的最近公共祖先 | Lowest Common Ancestor of a Binary Tree | 2019.4.12 | Medium | 7 |
55 | 235 | 二叉搜索树的最近公共祖先 | Lowest Common Ancestor of a Binary Search Tree | 2019.4.12 | Easy | 5 |
54 | 231 | 2的幂 | Power of Two | 2019.4.12 | Easy | 5 |
53 | 230 | 二叉搜索树中第K小的元素 | Kth Smallest Element in a BST | 2019.4.11 | Medium | 6 |
52 | 217 | 存在重复元素 | Contains Duplicate | 2019.4.11 | Easy | 3 |
51 | 215 | 数组中的第K个最大元素 | Kth Largest Element in an Array | 2019.4.11 | Medium | 6 |
50 | 206 | 反转链表 | Reverse Linked List | 2019.4.10 | Easy | 3 |
49 | 229 | 求众数 II | Majority Element II | 2019.4.10 | Medium | 7 |
48 | 169 | 求众数 | Majority Element | 2019.4.10 | Easy | 6 |
47 | 160 | 相交链表 | Intersection of Two Linked Lists | 2019.4.10 | Easy | 3 |
46 | 155 | 最小栈 | Min Stack | 2019.4.10 | Easy | 3 |
45 | 148 | 排序链表 | Sort List | 2019.4.9 | Medium | 7 |
44 | 146 | LRU缓存机制 | LRU Cache | 2019.4.9 | Hard | 9 |
43 | 518 | 零钱兑换 II | Coin Change 2 | 2019.4.8 | Medium | 7 |
42 | 322 | 零钱兑换 | Coin Change | 2019.4.7 | Medium | 7 |
41 | 871 | 最低加油次数 | Minimum Number of Refueling Stops | 2019.4.4 | Hard | 8 |
40 | 142 | 环形链表 II | Linked List Cycle II | 2019.4.4 | Medium | 5 |
39 | 141 | 环形链表 | Linked List Cycle | 2019.4.4 | Easy | 3 |
38 | 312 | 戳气球 | Burst Balloons | 2019.4.3 | Hard | 10 |
37 | 136 | 只出现一次的数字 | Single Number | 2019.4.2 | Easy | 3 |
36 | 124 | 二叉树中的最大路径和 | Binary Tree Maximum Path Sum | 2019.4.2 | Hard | 6 |
35 | 123 | 买卖股票的最佳时机 III | Best Time to Buy and Sell Stock III | 2019.4.2 | Hard | 8 |
34 | 122 | 买卖股票的最佳时机 II | Best Time to Buy and Sell Stock II | 2019.4.1 | Easy | 6 |
33 | 121 | 买卖股票的最佳时机 | Best Time to Buy and Sell Stock | 2019.4.1 | Easy | 5 |
32 | 89 | 格雷编码 | Gray Code | 2019.4.1 | Medium | 6 |
31 | 88 | 合并两个有序数组 | Merge Sorted Array | 2019.3.23 | Easy | 3 |
30 | 787 | K 站中转内最便宜的航班 | Cheapest Flights Within K Stops | 2019.3.15 | Medium | 9 |
29 | 78 | 子集 | Subsets | 2019.3.14 | Medium | 6 |
28 | 70 | 爬楼梯 | Climbing Stairs | 2019.3.13 | Easy | 5 |
27 | 62 | 不同路径 | [Unique Paths] | 2019.3.12 | Medium | 3 |
26 | 61 | 旋转链表 | Rotate List | 2019.3.8 | Medium | 5 |
25 | 59 | 螺旋矩阵 II | Spiral Matrix II | 2019.3.7 | Medium | 3 |
24 | 54 | 螺旋矩阵 | Spiral Matrix | 2019.3.6 | Medium | 3 |
23 | 53 | 最大子序和 | Maximum Subarray | 2019.3.5 | Easy | 6 |
22 | 46 | 全排列 | Permutations | 2019.3.4 | Medium | 6 |
21 | 43 | 字符串相乘 | Multiply Strings | 2019.3.3 | Medium | 5 |
20 | 33 | 搜索旋转排序数组 | Search in Rotated Sorted Array | 2019.3.2 | Medium | 5 |
19 | 26 | 删除排序数组中的重复项 | Remove Duplicates from Sorted Array | 2019.3.1 | Easy | 3 |
18 | 23 | 合并K个排序链表 | Merge k Sorted Lists | 2019.2.28 | Hard | 6 |
17 | 21 | 合并两个有序链表 | Merge Two Sorted Lists | 2019.2.27 | Easy | 3 |
16 | 20 | 有效的括号 | Valid Parentheses | 2019.2.26 | Easy | 3 |
15 | 16 | 最接近的三数之和 | 3Sum Closest | 2019.2.25 | Medium | 6 |
14 | 15 | 三数之和 | 3Sum | 2019.2.24 | Medium | 6 |
13 | 208 | 实现 Trie (前缀树) | Implement Trie (Prefix Tree) | 2019.2.24 | Medium | 6 |
12 | 14 | 最长公共前缀 | Longest Common Prefix | 2019.2.23 | Easy | 5 |
11 | 11 | 盛最多水的容器 | Container With Most Water | 2019.2.22 | Medium | 5 |
10 | 9 | 回文数 | Palindrome Number | 2019.2.21 | Easy | 4 |
9 | 8 | 字符串转换整数(atoi) | String to Integer | 2019.2.20 | Medium | 4 |
8 | 7 | 整数反转 | Reverse Integer | 2019.2.19 | Easy | 3 |
7 | 5 | 最长回文子串 | Longest Palindromic Substring | 2019.2.18 | Medium | 6 |
6 | 4 | 寻找两个有序数组的中位数 | Median of Two Sorted Arrays | 2019.2.17 | Hard | 6 |
5 | 2 | 两数相加 | Add Two Numbers | 2019.2.15 | Medium | 5 |
4 | 149 | 直线上最多的点数 | Max Points on a Line | 2018.8.19 | Hard | 8 |
3 | 150 | 逆波兰表达式/后缀表达式求值 | Evaluate Reverse Polish Notation | 2018.8.15 | Medium | 4 |
2 | 104 | 二叉树的最大深度 | Maximum Depth of Binary Tree | 2018.8.13 | Easy | 5 |
1 | 111 | 二叉树的最小深度 | Minimum Depth of Binary Tree | 2018.8.13 | Easy | 5 |