1 |
Two Sum, 两数之和 |
C |
Easy |
Two Pointers, 双指针 |
2 |
Add Two Numbers, 两数相加 |
C |
Medium |
Two Pointers, 双指针 |
3 |
Longest Substring Without Repeating Characters, 无重复字符的最长子串 |
C |
Medium |
Sliding Window, 滑动窗口 |
5 |
Longest Palindromic Substring, 最长回文子串 |
C |
Medium |
Dynamic Programming, 动态规划 |
6 |
Zigzag Conversion, Z 字形变换 |
C |
Medium |
|
7 |
Reverse Integer, 整数反转 |
C |
Easy |
|
8 |
String To Integer Atoi, 字符串转换整数 |
C |
Medium |
|
9 |
Palindrome Number, 回文数 |
C |
Easy |
Two Pointers, 双指针 |
10 |
Regular Expression Matching, 正则表达式匹配 |
C |
Hard |
Dynamic Programming, 动态规划 |
11 |
Container With Most Water, 盛最多水的容器 |
C |
Medium |
Two Pointers, 双指针 |
12 |
Integer To Roman, 整数转罗马数字 |
C |
Medium |
|
13 |
Roman To Integer, 罗马数字转整数 |
C |
Easy |
|
14 |
Longest Common Prefix, 最长公共前缀 |
C |
Easy |
Trie, 前缀树 |
15 |
Three Sum, 三数之和 |
C |
Medium |
|
16 |
3Sum Closest, 最接近的三数之和 |
C |
Medium |
|
17 |
Letter Combinations of a Phone Number, 电话号码的字母组合 |
C |
Medium |
|
18 |
4Sum, 四数之和 |
C |
Medium |
Two Pointers, 双指针 |
19 |
Remove Nth Node From End Of List, 删除链表的倒数第 N 个结点 |
C |
Medium |
Fast & Slow pointers, 快慢指针 |
20 |
Valid Parentheses, 有效的括号 |
C |
Easy |
Stack, 栈 |
21 |
Merge Two Sorted Lists, 合并两个有序链表 |
C |
Easy |
Two Pointers, 双指针 |
22 |
Generate Parentheses, 括号生成 |
C |
Medium |
Backtracking, 回溯 |
23 |
Merge K Sorted Lists, 合并K个升序链表 |
C |
Hard |
Stack, 栈 |
24 |
Swap Nodes in Pairs, 两两交换链表中的节点 |
C |
Medium |
|
25 |
Reverse Nodes in k-Group, K 个一组翻转链表 |
C |
Hard |
Fast & Slow pointers, 快慢指针 |
26 |
Remove Duplicates from Sorted Array, 删除有序数组中的重复项 |
C |
Easy |
Two Pointers, 双指针 |
27 |
Remove Element, 移除元素 |
C |
Easy |
Two Pointers, 双指针 |
28 |
Implement strStr(), 实现 strStr() |
C |
Easy |
|
29 |
Divide Two Integers, 两数相除 |
C |
Medium |
|
30 |
Substring with Concatenation of All Words, 串联所有单词的子串 |
C |
Hard |
|
31 |
Next Permutation, 下一个排列 |
C |
Medium |
|
32 |
Longest Valid Parentheses, 最长有效括号 |
C |
Hard |
Dynamic Programming, 动态规划 |
33 |
Search in Rotated Sorted Array, 搜索旋转排序数组 |
C |
Medium |
Binary Search, 二分查找 |
34 |
Find First and Last Position of Element in Sorted Array, 在排序数组中查找元素的第一个和最后一个位置 |
C |
Medium |
Binary Search, 二分查找 |
35 |
Search Insert Position, 搜索插入位置 |
C |
Easy |
Binary Search, 二分查找 |
36 |
Valid Sudoku, 有效的数独 |
C |
Medium |
|
37 |
Sudoku Solver, 解数独 |
C |
Hard |
Depth-First Search, 深度优先搜索 |
38 |
Count and Say, 外观数列 |
C |
Medium |
|
39 |
Combination Sum, 组合总和 |
C |
Medium |
Backtracking, 回溯 |
40 |
Combination Sum II, 组合总和 II |
C |
Medium |
Backtracking, 回溯 |
41 |
First Missing Positive, 缺失的第一个正数 |
C |
Hard |
Cyclic Sort, 循环排序 |
42 |
Trapping Rain Water, 接雨水 |
C |
Hard |
|
43 |
Multiply Strings, 字符串相乘 |
C |
Medium |
|
44 |
Wildcard Matching, 通配符匹配 |
C |
Hard |
Dynamic Programming, 动态规划 |
45 |
Jump Game II, 跳跃游戏 II |
C |
Medium |
|
46 |
Permutations, 全排列 |
C |
Medium |
Backtracking, 回溯 |
47 |
Permutations II, 全排列 II |
C |
Medium |
Backtracking, 回溯 |
48 |
Rotate Image, 旋转图像 |
C |
Medium |
|
49 |
Group Anagrams, 字母异位词分组 |
C |
Medium |
Hash Table, 哈希表 |
50 |
Pow(x, n) |
C |
Medium |
|
51 |
N-Queens, N 皇后 |
C |
Hard |
Backtracking, 回溯 |
52 |
N-Queens II, N皇后 II |
C |
Hard |
Backtracking, 回溯 |
53 |
Maximum Subarray, 最大子数组和 |
C |
Easy |
Dynamic Programming, 动态规划 |
54 |
Spiral Matrix, 螺旋矩阵 |
C |
Medium |
|
55 |
Jump Game, 跳跃游戏 |
C |
Medium |
|
56 |
Merge Intervals, 合并区间 |
C |
Medium |
|
57 |
Insert Interval, 插入区间 |
C |
Medium |
|
58 |
Length of Last Word, 最后一个单词的长度 |
C |
Easy |
|
59 |
Spiral Matrix II, 螺旋矩阵 II |
C |
Medium |
|
60 |
Permutation Sequence, 排列序列 |
C |
Hard |
|
61 |
Rotate List, 旋转链表 |
C |
Medium |
|
62 |
Unique Paths, 不同路径 |
C |
Medium |
|
63 |
Unique Paths II, 不同路径 II |
C |
Medium |
|
64 |
Minimum Path Sum, 最小路径和 |
C |
Medium |
|
65 |
Valid Number, 有效数字 |
C |
Hard |
Finite State Machine, 状态机 |
66 |
Plus One, 加一 |
C |
Easy |
|
67 |
Add Binary, 二进制求和 |
C |
Easy |
|
69 |
Sqrt(x) |
C |
Easy |
|
70 |
Climbing Stairs, 爬楼梯 |
C |
Easy |
|
71 |
Simplify Path, 简化路径 |
C |
Medium |
|
72 |
Edit Distance, 编辑距离 |
C |
Hard |
|
73 |
Set Matrix Zeroes, 矩阵置零 |
C |
Medium |
|
75 |
Sort Colors, 颜色分类 |
C |
Medium |
|
76 |
Minimum Window Substring, 最小覆盖子串 |
C |
Hard |
|
77 |
Combinations, 组合 |
C |
Medium |
|
78 |
Subsets, 子集 |
C |
Medium |
|
79 |
Word Search, 单词搜索 |
C |
Medium |
|
80 |
Remove Duplicates from Sorted Array II, 删除有序数组中的重复项 II |
C |
Medium |
|
82 |
Remove Duplicates from Sorted List II, 删除排序链表中的重复元素 II |
C |
Medium |
|
83 |
Remove Duplicates from Sorted List, 删除排序链表中的重复元素 |
C |
Easy |
|
84 |
Largest Rectangle in Histogram, 柱状图中最大的矩形 |
C |
Hard |
|
85 |
Maximal Rectangle, 最大矩形 |
C |
Hard |
|
86 |
Partition List, 分隔链表 |
C |
Easy |
|
87 |
Scramble String, 扰乱字符串 |
C |
Hard |
|
88 |
Merge Sorted Array, 合并两个有序数组 |
C |
Easy |
|
89 |
Gray Code, 格雷编码 |
C |
Medium |
|
90 |
Subsets II, 子集 II |
C |
Medium |
|
91 |
Decode Ways, 解码方法 |
C |
Medium |
|
92 |
Reverse Linked List II, 反转链表 II |
C |
Medium |
|
93 |
Restore IP Addresses, 复原 IP 地址 |
C |
Medium |
|
94 |
Binary Tree Inorder Traversal, 二叉树的中序遍历 |
C |
Easy |
|
96 |
Unique Binary Search Trees, 不同的二叉搜索树 |
C |
Medium |
|
97 |
Interleaving String, 交错字符串 |
C |
Medium |
|
98 |
Validate Binary Search Tree, 验证二叉搜索树 |
C |
Medium |
|
99 |
Recover Binary Search Tree, 恢复二叉搜索树 |
C |
Medium |
|
100 |
Same Tree, 相同的树 |
C |
Easy |
|
101 |
Symmetric Tree, 对称二叉树 |
C |
Easy |
|
102 |
Binary Tree Level Order Traversal, 二叉树的层序遍历 |
C |
Medium |
|
103 |
Binary Tree Zigzag Level Order Traversal, 二叉树的锯齿形层序遍历 |
C |
Medium |
|
104 |
Maximum Depth of Binary Tree, 二叉树的最大深度 |
C |
Easy |
|
105 |
Construct Binary Tree from Preorder and Inorder Traversal, 从前序与中序遍历序列构造二叉树 |
C |
Medium |
|
106 |
Construct Binary Tree from Inorder and Postorder Traversal, 从中序与后序遍历序列构造二叉树 |
C |
Medium |
|
107 |
Binary Tree Level Order Traversal II, 二叉树的层序遍历 II |
C |
Medium |
|
108 |
Convert Sorted Array to Binary Search Tree, 将有序数组转换为二叉搜索树 |
C |
Easy |
|
109 |
Convert Sorted List to Binary Search Tree, 有序链表转换二叉搜索树 |
C |
Medium |
|
110 |
Balanced Binary Tree, 平衡二叉树 |
C |
Easy |
|
111 |
Minimum Depth of Binary Tree, 二叉树的最小深度 |
C |
Easy |
|
112 |
Path Sum, 路径总和 |
C |
Easy |
|
113 |
Path Sum II, 路径总和 II |
C |
Medium |
|
114 |
Flatten Binary Tree to Linked List, 二叉树展开为链表 |
C |
Medium |
|
115 |
Distinct Subsequences, 不同的子序列 |
C |
Hard |
|
116 |
Populating Next Right Pointers in Each Node, 填充每个节点的下一个右侧节点指针 |
C |
Medium |
|
117 |
Populating Next Right Pointers in Each Node II, 填充每个节点的下一个右侧节点指针 II |
C |
Medium |
|
118 |
Pascal's Triangle, 杨辉三角 |
C |
Easy |
|
119 |
Pascal's Triangle II, 杨辉三角 II |
C |
Easy |
|
120 |
Triangle, 三角形最小路径和 |
C |
Medium |
|
121 |
Best Time to Buy and Sell Stock, 买卖股票的最佳时机 |
C |
Easy |
|
122 |
Best Time to Buy and Sell Stock II, 买卖股票的最佳时机 II |
C |
Medium |
|
124 |
Binary Tree Maximum Path Sum, 二叉树中的最大路径和 |
C |
Hard |
|
125 |
Valid Palindrome, 验证回文串 |
C |
Easy |
|
127 |
Word Ladder, 单词接龙 |
C |
Hard |
|
128 |
Longest Consecutive Sequence, 最长连续序列 |
C |
Medium |
|
129 |
Sum Root to Leaf Numbers, 求根节点到叶节点数字之和 |
C |
Medium |
|
130 |
Surrounded Regions, 被围绕的区域 |
C |
Medium |
|
133 |
Clone Graph, 克隆图 |
C |
Medium |
|
134 |
Gas Station, 加油站 |
C |
Medium |
|
136 |
Single Number, 只出现一次的数字 |
C |
Easy |
|
137 |
Single Number II, 只出现一次的数字 II |
C |
Medium |
|
138 |
Copy List with Random Pointer, 复制带随机指针的链表 |
C |
Medium |
|
139 |
Word Break, 单词拆分 |
C |
Medium |
|
140 |
Word Break II, 单词拆分 II |
C |
Hard |
|
141 |
Linked List Cycle, 环形链表 |
C |
Easy |
|
142 |
Linked List Cycle II, 环形链表 II |
C |
Medium |
|
143 |
Reorder List, 重排链表 |
C |
Medium |
|
144 |
Binary Tree Preorder Traversal, 二叉树的前序遍历 |
C |
Easy |
|
145 |
Binary Tree Postorder Traversal, 二叉树的后序遍历 |
C |
Easy |
|
146 |
LRU Cache, LRU 缓存 |
C |
Medium |
|
147 |
Insertion Sort List, 对链表进行插入排序 |
C |
Medium |
|
148 |
Sort List, 排序链表 |
C |
Medium |
|
149 |
Max Points on a Line, 直线上最多的点数 |
C |
Hard |
|
150 |
Evaluate Reverse Polish Notation, 逆波兰表达式求值 |
C |
Medium |
|
151 |
Reverse Words in a String, 翻转字符串里的单词 |
C |
Medium |
|
152 |
Maximum Product Subarray, 乘积最大子数组 |
C |
Medium |
|
153 |
Find Minimum in Rotated Sorted Array, 寻找旋转排序数组中的最小值 |
C |
Medium |
|
154 |
Find Minimum in Rotated Sorted Array II, 寻找旋转排序数组中的最小值 II |
C |
Hard |
|
155 |
Min Stack, 最小栈 |
C |
Easy |
|
160 |
Intersection of Two Linked Lists, 相交链表 |
C |
Easy |
|
162 |
Find Peak Element, 寻找峰值 |
C |
Medium |
|
165 |
Compare Version Numbers, 比较版本号 |
C |
Medium |
|
166 |
Fraction to Recurring Decimal, 分数到小数 |
C |
Medium |
|
167 |
Two Sum II - Input Array Is Sorted, 两数之和 II - 输入有序数组 |
C |
Medium |
|
168 |
Excel Sheet Column Title, Excel表列名称 |
C |
Easy |
|
169 |
Majority Element, 多数元素 |
C |
Easy |
|
171 |
Excel Sheet Column Number, Excel 表列序号 |
C |
Easy |
|
172 |
Factorial Trailing Zeroes, 阶乘后的零 |
C |
Medium |
|
173 |
Binary Search Tree Iterator, 二叉搜索树迭代器 |
C |
Medium |
|
179 |
Largest Number, 最大数 |
C |
Medium |
|
187 |
Repeated DNA Sequences, 重复的DNA序列 |
C |
Medium |
|
189 |
Rotate Array, 轮转数组 |
C |
Medium |
|
190 |
Reverse Bits, 颠倒二进制位 |
C |
Easy |
|
191 |
Number of 1 Bits, 位1的个数 |
C |
Easy |
|
198 |
House Robber, 打家劫舍 |
C |
Medium |
|
199 |
Binary Tree Right Side View, 二叉树的右视图 |
C |
Medium |
|
200 |
Number of Islands, 岛屿数量 |
C |
Medium |
|
202 |
Happy Number, 快乐数 |
C |
Easy |
|
204 |
Count Primes, 计数质数 |
C |
Medium |
|
206 |
Reverse Linked List, 反转链表 |
C |
Easy |
|
207 |
Course Schedule, 课程表 |
C |
Medium |
|
208 |
Implement Trie (Prefix Tree), 实现 Trie (前缀树) |
C |
Medium |
|
209 |
Minimum Size Subarray Sum, 长度最小的子数组 |
C |
Medium |
|
210 |
Course Schedule II, 课程表 II |
C |
Medium |
|
213 |
House Robber II, 打家劫舍 II |
C |
Medium |
|
215 |
Kth Largest Element in an Array, 数组中的第K个最大元素 |
C |
Medium |
|
218 |
The Skyline Problem, 天际线问题 |
C |
Hard |
|
221 |
Maximal Square, 最大正方形 |
C |
Medium |
|
223 |
Rectangle Area, 矩形面积 |
C |
Medium |
|
224 |
Basic Calculator, 基本计算器 |
C |
Hard |
|
230 |
Kth Smallest Element in a BST, 二叉搜索树中第K小的元素 |
C |
Easy |
|
232 |
Implement Queue using Stacks, 用栈实现队列 |
C |
Easy |
|
233 |
Number of Digit One, 数字 1 的个数 |
C |
Hard |
|
234 |
Palindrome Linked List, 回文链表 |
C |
Easy |
Fast & Slow pointers, 快慢指针 |
235 |
Lowest Common Ancestor of a Binary Search Tree, 二叉搜索树的最近公共祖先 |
C |
Easy |
|
236 |
Lowest Common Ancestor of a Binary Tree, 二叉树的最近公共祖先 |
C |
Medium |
|
238 |
Product of Array Except Self, 除自身以外数组的乘积 |
C |
Medium |
|
239 |
Sliding Window Maximum, 滑动窗口最大值 |
C |
Hard |
Sliding Window, 滑动窗口 |
263 |
Ugly Number, 丑数 |
C |
Easy |
|
264 |
Ugly Number II, 丑数 II |
C |
Medium |
|
273 |
Integer to English Words, 整数转换英文表示 |
C |
Medium |
|
274 |
H-Index, H 指数 |
C |
Medium |
|
279 |
Perfect Squares, 完全平方数 |
C |
Medium |
|
295 |
Find Median from Data Stream, 数据流的中位数 |
C |
Hard |
Two Heaps, 双堆 |
300 |
Longest Increasing Subsequence, 最长递增子序列 |
C |
Medium |
|
312 |
Burst Balloons, 戳气球 |
C |
Hard |
|
313 |
Super Ugly Number, 超级丑数 |
C |
Medium |
|
322 |
Coin Change, 零钱兑换 |
C |
Medium |
|
326 |
Power of Three, 3 的幂 |
C |
Easy |
|
328 |
Odd Even Linked List, 奇偶链表 |
C |
Medium |
|
329 |
Longest Increasing Path in a Matrix, 矩阵中的最长递增路径 |
C |
Hard |
|
334 |
Increasing Triplet Subsequence, 递增的三元子序列 |
C |
Medium |
|
338 |
Counting Bits, 比特位计数 |
C |
Easy |
|
343 |
Integer Break, 整数拆分 |
C |
Medium |
|
347 |
Top K Frequent Elements, 前 K 个高频元素 |
C |
Medium |
|
354 |
Russian Doll Envelopes, 俄罗斯套娃信封问题 |
C |
Hard |
|
380 |
Insert Delete GetRandom O(1), O(1) 时间插入、删除和获取随机元素 |
C |
Medium |
|
381 |
Insert Delete GetRandom O(1) - Duplicates allowed, O(1) 时间插入、删除和获取随机元素 - 允许重复 |
C |
Hard |
|
384 |
Shuffle an Array, 打乱数组 |
C |
Medium |
|
392 |
Is Subsequence, 判断子序列 |
C |
Easy |
|
395 |
Longest Substring with At Least K Repeating Characters, 至少有 K 个重复字符的最长子串 |
C |
Medium |
|
416 |
Partition Equal Subset Sum, 分割等和子集 |
C |
Medium |
|
438 |
Find All Anagrams in a String, 找到字符串中所有字母异位词 |
C |
Medium |
|
460 |
LFU Cache, LFU 缓存 |
C |
Hard |
|
476 |
Number Complement, 数字的补数 |
C |
Easy |
|
494 |
Target Sum, 目标和 |
C |
Medium |
|
498 |
Diagonal Traverse, 对角线遍历 |
C |
Medium |
|
537 |
Complex Number Multiplication, 复数乘法 |
C |
Medium |
|
540 |
Single Element in a Sorted Array, 有序数组中的单一元素 |
C |
Medium |
|
543 |
Diameter of Binary Tree, 二叉树的直径 |
C |
Easy |
|
547 |
Number of Provinces, 省份数量 |
C |
Medium |
|
560 |
Subarray Sum Equals K, 和为 K 的子数组 |
C |
Medium |
|
567 |
Permutation in String, 字符串的排列 |
C |
Medium |
|
605 |
Can Place Flowers, 种花问题 |
C |
Easy |
|
662 |
Maximum Width of Binary Tree, 二叉树最大宽度 |
C |
Medium |
|
695 |
Max Area of Island, 岛屿的最大面积 |
C |
Medium |
|
704 |
Binary Search, 二分查找 |
C |
Easy |
|
717 |
1-bit and 2-bit Characters, 1比特与2比特字符 |
C |
Easy |
|
739 |
Daily Temperatures, 每日温度 |
C |
Medium |
|
765 |
Couples Holding Hands, 情侣牵手 |
C |
Hard |
|
827 |
Making A Large Island, 最大人工岛 |
C |
Hard |
|
841 |
Keys and Rooms, 钥匙和房间 |
C |
Medium |
|
844 |
Backspace String Compare, 比较含退格的字符串 |
C |
Easy |
|
876 |
Middle of the Linked List, 链表的中间结点 |
C |
Easy |
|
887 |
Super Egg Drop, 鸡蛋掉落 |
C |
Hard |
|
925 |
Long Pressed Name, 长按键入 |
C |
Easy |
|
946 |
Validate Stack Sequences, 验证栈序列 |
C |
Medium |
|
957 |
Prison Cells After N Days, N 天后的牢房 |
C |
Medium |
|
969 |
Pancake Sorting, 煎饼排序 |
C |
Medium |
|
977 |
Squares of a Sorted Array, 有序数组的平方 |
C |
Easy |
|
1009 |
Complement of Base 10 Integer, 十进制整数的反码 |
C |
Easy |
|
1019 |
Next Greater Node In Linked List, 链表中的下一个更大节点 |
C |
Medium |
|
1046 |
Last Stone Weight, 最后一块石头的重量 |
C |
Easy |
|
1089 |
Duplicate Zeros, 复写零 |
C |
Easy |
|
1290 |
Convert Binary Number in a Linked List to Integer, 二进制链表转整数 |
C |
Easy |
|
2166 |
Design Bitset, 设计位集 |
C |
Medium |
|