LeetCode 热题 100
力扣最受刷题发烧友欢迎的 100 道题
哈希
3 题| 顺序 | 难度 | 题目 |
|---|---|---|
| 1 | 简单 | Two Sum |
| 2 | 中等 | Group Anagrams |
| 3 | 中等 | Longest Consecutive Sequence |
- #1简单#1站内精讲
Two Sum
- #2中等#49站内精讲
Group Anagrams
- #3中等#128站内精讲
Longest Consecutive Sequence
双指针
4 题| 顺序 | 难度 | 题目 |
|---|---|---|
| 4 | 简单 | Move Zeroes |
| 5 | 中等 | Container With Most Water |
| 6 | 中等 | 3Sum |
| 7 | 困难 | Trapping Rain Water |
- #4简单#283站内精讲
Move Zeroes
- #5中等#11站内精讲
Container With Most Water
- #6中等#15站内精讲
3Sum
- #7困难#42站内精讲
Trapping Rain Water
滑动窗口
2 题| 顺序 | 难度 | 题目 |
|---|---|---|
| 8 | 中等 | Longest Substring Without Repeating Characters |
| 9 | 中等 | Find All Anagrams in a String |
- #8中等#3站内精讲
Longest Substring Without Repeating Characters
- #9中等#438站内精讲
Find All Anagrams in a String
子串
3 题| 顺序 | 难度 | 题目 |
|---|---|---|
| 10 | 中等 | Subarray Sum Equals K |
| 11 | 困难 | Sliding Window Maximum |
| 12 | 困难 | Minimum Window Substring |
- #10中等#560站内精讲
Subarray Sum Equals K
- #11困难#239站内精讲
Sliding Window Maximum
- #12困难#76站内精讲
Minimum Window Substring
普通数组
5 题| 顺序 | 难度 | 题目 |
|---|---|---|
| 13 | 中等 | Maximum Subarray |
| 14 | 中等 | 合并区间#56 Merge Intervals |
| 15 | 中等 | 轮转数组#189 Rotate Array |
| 16 | 中等 | 除了自身以外数组的乘积#238 Product of Array Except Self |
| 17 | 困难 | 缺失的第一个正数#41 First Missing Positive |
- #13中等#53站内精讲
Maximum Subarray
- #14中等#56
Merge Intervals
- #15中等#189
Rotate Array
- #16中等#238
Product of Array Except Self
- #17困难#41
First Missing Positive
矩阵
4 题| 顺序 | 难度 | 题目 |
|---|---|---|
| 18 | 中等 | 矩阵置零#73 Set Matrix Zeroes |
| 19 | 中等 | 螺旋矩阵#54 Spiral Matrix |
| 20 | 中等 | 旋转图像#48 Rotate Image |
| 21 | 中等 | 搜索二维矩阵 II#240 Search a 2D Matrix II |
- #18中等#73
Set Matrix Zeroes
- #19中等#54
Spiral Matrix
- #20中等#48
Rotate Image
- #21中等#240
Search a 2D Matrix II
链表
14 题| 顺序 | 难度 | 题目 |
|---|---|---|
| 22 | 简单 | 相交链表#160 Intersection of Two Linked Lists |
| 23 | 简单 | Reverse Linked List |
| 24 | 简单 | 回文链表#234 Palindrome Linked List |
| 25 | 简单 | Linked List Cycle |
| 26 | 中等 | 环形链表 II#142 Linked List Cycle II |
| 27 | 简单 | Merge Two Sorted Lists |
| 28 | 中等 | 两数相加#2 Add Two Numbers |
| 29 | 中等 | Remove Nth Node From End of List |
| 30 | 中等 | 两两交换链表中的节点#24 Swap Nodes in Pairs |
| 31 | 困难 | K 个一组翻转链表#25 Reverse Nodes in k-Group |
| 32 | 中等 | 随机链表的复制#138 Copy List with Random Pointer |
| 33 | 中等 | 排序链表#148 Sort List |
| 34 | 困难 | 合并 K 个升序链表#23 Merge k Sorted Lists |
| 35 | 中等 | LRU 缓存#146 LRU Cache |
- #22简单#160
Intersection of Two Linked Lists
- #23简单#206站内精讲
Reverse Linked List
- #24简单#234
Palindrome Linked List
- #25简单#141站内精讲
Linked List Cycle
- #26中等#142
Linked List Cycle II
- #27简单#21站内精讲
Merge Two Sorted Lists
- #28中等#2
Add Two Numbers
- #29中等#19
Remove Nth Node From End of List
- #30中等#24
Swap Nodes in Pairs
- #31困难#25
Reverse Nodes in k-Group
- #32中等#138
Copy List with Random Pointer
- #33中等#148
Sort List
- #34困难#23
Merge k Sorted Lists
- #35中等#146
LRU Cache
二叉树
15 题| 顺序 | 难度 | 题目 |
|---|---|---|
| 36 | 简单 | 二叉树的中序遍历#94 Binary Tree Inorder Traversal |
| 37 | 简单 | 二叉树的最大深度#104 Maximum Depth of Binary Tree |
| 38 | 简单 | Invert Binary Tree |
| 39 | 简单 | 对称二叉树#101 Symmetric Tree |
| 40 | 简单 | 二叉树的直径#543 Diameter of Binary Tree |
| 41 | 中等 | 二叉树的层序遍历#102 Binary Tree Level Order Traversal |
| 42 | 简单 | 将有序数组转换为二叉搜索树#108 Convert Sorted Array to Binary Search Tree |
| 43 | 中等 | 验证二叉搜索树#98 Validate Binary Search Tree |
| 44 | 中等 | 二叉搜索树中第 K 小的元素#230 Kth Smallest Element in a BST |
| 45 | 中等 | 二叉树的右视图#199 Binary Tree Right Side View |
| 46 | 中等 | 二叉树展开为链表#114 Flatten Binary Tree to Linked List |
| 47 | 中等 | 从前序与中序遍历序列构造二叉树#105 Construct Binary Tree from Preorder and Inorder Traversal |
| 48 | 中等 | 路径总和 III#437 Path Sum III |
| 49 | 中等 | 二叉树的最近公共祖先#236 Lowest Common Ancestor of a Binary Tree |
| 50 | 困难 | 二叉树中的最大路径和#124 Binary Tree Maximum Path Sum |
- #36简单#94
Binary Tree Inorder Traversal
- #37简单#104
Maximum Depth of Binary Tree
- #38简单#226站内精讲
Invert Binary Tree
- #39简单#101
Symmetric Tree
- #40简单#543
Diameter of Binary Tree
- #41中等#102
Binary Tree Level Order Traversal
- #42简单#108
Convert Sorted Array to Binary Search Tree
- #43中等#98
Validate Binary Search Tree
- #44中等#230
Kth Smallest Element in a BST
- #45中等#199
Binary Tree Right Side View
- #46中等#114
Flatten Binary Tree to Linked List
- #47中等#105
Construct Binary Tree from Preorder and Inorder Traversal
- #48中等#437
Path Sum III
- #49中等#236
Lowest Common Ancestor of a Binary Tree
- #50困难#124
Binary Tree Maximum Path Sum
图论
4 题| 顺序 | 难度 | 题目 |
|---|---|---|
| 51 | 中等 | 岛屿数量#200 Number of Islands |
| 52 | 中等 | 腐烂的橘子#994 Rotting Oranges |
| 53 | 中等 | 课程表#207 Course Schedule |
| 54 | 中等 | 实现 Trie (前缀树)#208 Implement Trie (Prefix Tree) |
- #51中等#200
Number of Islands
- #52中等#994
Rotting Oranges
- #53中等#207
Course Schedule
- #54中等#208
Implement Trie (Prefix Tree)
回溯
8 题| 顺序 | 难度 | 题目 |
|---|---|---|
| 55 | 中等 | 全排列#46 Permutations |
| 56 | 中等 | 子集#78 Subsets |
| 57 | 中等 | 电话号码的字母组合#17 Letter Combinations of a Phone Number |
| 58 | 中等 | 组合总和#39 Combination Sum |
| 59 | 中等 | 括号生成#22 Generate Parentheses |
| 60 | 中等 | 单词搜索#79 Word Search |
| 61 | 中等 | 分割回文串#131 Palindrome Partitioning |
| 62 | 困难 | N 皇后#51 N-Queens |
- #55中等#46
Permutations
- #56中等#78
Subsets
- #57中等#17
Letter Combinations of a Phone Number
- #58中等#39
Combination Sum
- #59中等#22
Generate Parentheses
- #60中等#79
Word Search
- #61中等#131
Palindrome Partitioning
- #62困难#51
N-Queens
二分查找
6 题| 顺序 | 难度 | 题目 |
|---|---|---|
| 63 | 简单 | 搜索插入位置#35 Search Insert Position |
| 64 | 中等 | 搜索二维矩阵#74 Search a 2D Matrix |
| 65 | 中等 | Find First and Last Position of Element in Sorted Array |
| 66 | 中等 | 搜索旋转排序数组#33 Search in Rotated Sorted Array |
| 67 | 中等 | 寻找旋转排序数组中的最小值#153 Find Minimum in Rotated Sorted Array |
| 68 | 困难 | Median of Two Sorted Arrays |
- #63简单#35
Search Insert Position
- #64中等#74
Search a 2D Matrix
- #65中等#34
Find First and Last Position of Element in Sorted Array
- #66中等#33
Search in Rotated Sorted Array
- #67中等#153
Find Minimum in Rotated Sorted Array
- #68困难#4
Median of Two Sorted Arrays
栈
5 题| 顺序 | 难度 | 题目 |
|---|---|---|
| 69 | 简单 | Valid Parentheses |
| 70 | 中等 | 最小栈#155 Min Stack |
| 71 | 中等 | Decode String |
| 72 | 中等 | 每日温度#739 Daily Temperatures |
| 73 | 困难 | 柱状图中最大的矩形#84 Largest Rectangle in Histogram |
- #69简单#20站内精讲
Valid Parentheses
- #70中等#155
Min Stack
- #71中等#394站内精讲
Decode String
- #72中等#739
Daily Temperatures
- #73困难#84
Largest Rectangle in Histogram
堆
3 题| 顺序 | 难度 | 题目 |
|---|---|---|
| 74 | 中等 | 数组中的第K个最大元素#215 Kth Largest Element in an Array |
| 75 | 中等 | 前 K 个高频元素#347 Top K Frequent Elements |
| 76 | 困难 | 数据流的中位数#295 Find Median from Data Stream |
- #74中等#215
Kth Largest Element in an Array
- #75中等#347
Top K Frequent Elements
- #76困难#295
Find Median from Data Stream
贪心算法
4 题| 顺序 | 难度 | 题目 |
|---|---|---|
| 77 | 简单 | 买卖股票的最佳时机#121 Best Time to Buy and Sell Stock |
| 78 | 中等 | 跳跃游戏#55 Jump Game |
| 79 | 中等 | 跳跃游戏 II#45 Jump Game II |
| 80 | 中等 | 划分字母区间#763 Partition Labels |
- #77简单#121
Best Time to Buy and Sell Stock
- #78中等#55
Jump Game
- #79中等#45
Jump Game II
- #80中等#763
Partition Labels
动态规划
10 题| 顺序 | 难度 | 题目 |
|---|---|---|
| 81 | 简单 | Climbing Stairs |
| 82 | 简单 | 杨辉三角#118 Pascal's Triangle |
| 83 | 中等 | 打家劫舍#198 House Robber |
| 84 | 中等 | 完全平方数#279 Perfect Squares |
| 85 | 中等 | 零钱兑换#322 Coin Change |
| 86 | 中等 | 单词拆分#139 Word Break |
| 87 | 中等 | 最长递增子序列#300 Longest Increasing Subsequence |
| 88 | 中等 | 乘积最大子数组#152 Maximum Product Subarray |
| 89 | 中等 | 分割等和子集#416 Partition Equal Subset Sum |
| 90 | 困难 | 最长有效括号#32 Longest Valid Parentheses |
- #81简单#70站内精讲
Climbing Stairs
- #82简单#118
Pascal's Triangle
- #83中等#198
House Robber
- #84中等#279
Perfect Squares
- #85中等#322
Coin Change
- #86中等#139
Word Break
- #87中等#300
Longest Increasing Subsequence
- #88中等#152
Maximum Product Subarray
- #89中等#416
Partition Equal Subset Sum
- #90困难#32
Longest Valid Parentheses
多维动态规划
5 题| 顺序 | 难度 | 题目 |
|---|---|---|
| 91 | 中等 | 不同路径#62 Unique Paths |
| 92 | 中等 | 最小路径和#64 Minimum Path Sum |
| 93 | 中等 | 最长回文子串#5 Longest Palindromic Substring |
| 94 | 中等 | 最长公共子序列#1143 Longest Common Subsequence |
| 95 | 中等 | 编辑距离#72 Edit Distance |
- #91中等#62
Unique Paths
- #92中等#64
Minimum Path Sum
- #93中等#5
Longest Palindromic Substring
- #94中等#1143
Longest Common Subsequence
- #95中等#72
Edit Distance
技巧
5 题| 顺序 | 难度 | 题目 |
|---|---|---|
| 96 | 简单 | Single Number |
| 97 | 简单 | 多数元素#169 Majority Element |
| 98 | 中等 | 颜色分类#75 Sort Colors |
| 99 | 中等 | 下一个排列#31 Next Permutation |
| 100 | 中等 | 寻找重复数#287 Find the Duplicate Number |
- #96简单#136站内精讲
Single Number
- #97简单#169
Majority Element
- #98中等#75
Sort Colors
- #99中等#31
Next Permutation
- #100中等#287
Find the Duplicate Number