Skip to content

kaisa911/LeetCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

刷题记录

some exercises of leetcode

  • Leetcode: 简单: 169, 中等: 219, 困难: 52, 剑指Offer: 73,
  • 总计:513
pie title 已完成的题目
    "简单" : 169
    "中等" : 219
    "困难" : 52
    "剑指Offer" : 73
Loading
Number Name Difficulty label
1 Two Sum 两数之和 Easy 哈希
2 Add Two Numbers 两数相加 Medium 链表
3 Longest Substring Without Repeating Characters 无重复字符的最长子串 Medium 滑动窗口
4 Median of Two Sorted Arrays 寻找两个正序数组的中位数 Hard 数组
5 Longest Palindromic Substring 最长回文子串 Medium 双指针
6 ZigZag Conversion Z 字形变换 Medium 字符串
7 Reverse Integer 翻转整数 Medium 字符串
8 String to Integer (atoi) 字符串转为整数 Medium 字符串
9 Palindrome Number 回文数字 Easy 数学
10 Regular Expression Matching 正则表达式匹配 Hard 正则、字符串
11 Container With Most Water 盛最多水的容器 Medium 双指针
12 Integer to Roman 整数转罗马数字 Medium 字符串
13 Roman to Integer 罗马数字转整数 Easy 字符串
14 Longest Common Prefix 最长共同前缀 Easy 数组
15 3 Sum 三数之和 Medium 双指针、排序
16 3 Sum Closest 最接近的三数之和 Medium 双指针、排序
17 Letter Combinations of a Phone Number 电话号码的字母组合 Medium 字符串、回溯
18 4 Sum 四数之和 Medium 双指针法、排序
19 Remove Nth Node From End of List 删除链表的倒数第 N 个节点 Medium 快慢指针
20 Valid Parentheses 有效的括号 Easy
21 Merge Two Sorted Lists 合并两个有序链表 Easy 链表
22 Generate Parentheses 生成括号 Medium 回溯
23 Merge k Sorted Lists 合并 K 个排序链表 Hard 链表、分治
24 Swap Nodes In Pairs 两两交换链表中的节点 Medium 链表、迭代法
25 Reverse Nodes in k-Group 每 k 个一组翻转链表 Hard 迭代、递归、链表
26 Remove Duplicates from Sorted Array 从有序数组中删除重复项 Easy 双指针
27 Remove Element 移除元素 Easy 双指针
28 Implement strStr() 实现 strStr() Easy KMP算法
29 Divide Two Integers 两数相除 Medium 贪心、位运算
30 Substring with Concatenation of All Words 串联所有单词的子串 Hard 字符串、滑动窗口
31 Next-permutation 下一个排列 Medium 数组
32 Longest Valid Parentheses 最长有效括号 Hard
33 Search in Rotated Sorted Array 在旋转有序数组中搜索 Medium 数组、二分查找
34 Search for a Range 搜索范围 Medium 二分查找
35 Search Insert Position 搜索插入位置 Easy 二分查找
36 Valid Sudoku 验证数独 Medium 数组
37 Sudoku Solver 解数独 Hard DFS、回溯
38 Count and Say 数数并说 Medium 字符串
39 Combination Sum 组合之和 Medium 回溯、数组
40 Combination Sum II 组合之和 II Medium 回溯、数组
41 First Missing Positive 缺失的第一个正数 Hard 数组
42 Trapping Rain Water 接雨水 Hard 双指针
43 Multiply String 字符串相乘 Medium 字符串
44 Wildcard Matching 通配符匹配 Hard 动态规划
45 Jump Game II 跳跃游戏 II Medium 数组、贪心
46 Permutations 全排列 Medium 回溯
47 Permutations II 全排列 II Medium 回溯
48 Rotate Image 旋转图像 Medium 数组
49 Group Anagrams 字母异位词分组 Medium 哈希、排序
50 Pow(x, n) Pow(x, n) Medium 数学
51 N-Queens N 皇后 Hard 回溯
52 N-Queens II N 皇后 II Hard 回溯
53 Maximum Subarray 最大子数组和 Medium Kadane算法、动态规划
54 Spiral Matrix 螺旋矩阵 Medium 矩阵
55 Jump Game 跳跃游戏 Medium 数组
56 Merge Intervals 合并区间 Medium 数组、排序
57 Insert Interval 插入区间 Hard 数组、排序
58 Length of Last Word 最后一个单词的长度 Easy 字符串
59 Spiral Matrix II 螺旋矩阵 II Medium 矩阵
60 Permutation Sequence 排列序列 Hard 数学
61 Rotate List 旋转链表 Medium 链表
62 Unique Paths 不同路径 Medium 动态规划
63 Unique Paths II 不同路径 II Medium 动态规划
64 Minimum Path Sum 最小路径和 Medium 动态规划
65 Valid Number 有效数字 Hard 正则
66 Plus One 加一 Easy 数组
67 Add Binary 二进制求和 Easy 字符串
68 Text Justification 文本左右对齐 Hard 贪心
69 Sqrt(x) x 的平方根 Easy 二分法
70 Climbing Stairs 爬楼梯 Easy 动态规划
71 Simplify Path 简化路径 Medium
72 Edit Distance 编辑距离 Hard 动态规划
73 Set Matrix Zeroes 矩阵置零 Medium 矩阵
74 Search a 2D Matrix 搜索二维矩阵 Medium 矩阵
75 Sort Colors 颜色分类 Medium 快排
76 Minimum Window Substring 最小覆盖子串 Hard 子串、滑动窗口
77 Combinations 组合 Medium 回溯
78 Subsets 子集 Medium 回溯
79 Word Search 单词搜索 Medium 回溯、DFS
80 Remove Duplicates from Sorted Array II 删除排序数组中的重复项 II Medium 贪心
81 Searching Rotated Sorted Array II 搜索旋转排序数组 II Medium 二分搜索
82 Remove Duplicate From Sorted List II 删除排序链表中的重复元素 II Medium 链表、双指针
83 Remove Duplicates from Sorted List 删除排序链表中的重复元素 Easy 链表
84 Largest Rectangle in Histogram 柱状图中最大的矩形 Hard 单调栈
85 Maximal Rectangle 最大矩形 Hard 单调栈
86 Partition List 分隔链表 Medium 链表
87 Scramble String 扰乱字符串 Hard 分治、哈希
88 Merge Sorted Array 合并两个有序数组 Easy 数组、排序
89 Gray Code 格雷编码 Medium 数组
90 Subsets II 子集 II Medium 回溯
91 Decode Ways 解码方法 Medium 动态规划
92 Reverse Linked List II 反转链表 II Medium 链表
93 Restore Ip Address 复原 IP 地址 Medium DFS
94 Binary Tree Inorder Traversal 二叉树的中序遍历 Medium 递归、二叉树
95 Unique Binary Search Trees II 不同的二叉搜索树 II Medium 二叉树、递归
96 Unique Binary Search Trees 不同的二叉搜索树 Medium 卡特兰数
97 Interleaving String 交错字符串 Medium 动态规划
98 Validate Binary Search Tree 验证搜索二叉树 Medium 二叉树
99 Recover Binary Search Tree 恢复搜索二叉树 Medium 二叉树
100 Same Tree 相同的树 Easy 二叉树
101 Symmetric Tree 对称二叉树 Easy BFS
102 Binary Tree Level Order Traversal 二叉树的层序遍历 Medium 二叉树
103 Binary Tree Zigzag Level Order Traversal 二叉树的锯齿形层序遍历 Medium BFS
104 Maximum Depth of Binary Tree 二叉树最大深度 Easy DFS
105 Construct Binary Tree from Preorder and Inorder Traversal 从前序与中序遍历序列构造二叉树 Medium 二叉树
106 Construct Binary Tree from In order and Post order Traversal 从中序与后序遍历序列构造二叉树 Medium 二叉树
107 Binary Tree Level Order Traversal II 二叉树的层次遍历 II Easy 二叉树
108 Convert Sorted Array to Binary Search Tree 将有序数组转换成二叉搜索树 Easy 二叉树
109 Convert Sorted List to Binary Search Tree 将有序链表转换为二叉搜索树 Medium 链表、二叉树
110 Balanced Binary Tree 平衡二叉树 Easy 二叉树
111 Minimum Depth of Binary Tree 二叉树的最小深度 Easy 二叉树
112 Path Sum 路径总和 Easy 递归
113 Path Sum II 路径总和 II Medium 回溯
114 Flat Binary Tree to Linked List 二叉树展开为链表 Medium 二叉树、链表
115 Distinct Subsequences 不同的子序列 Hard 动态规划
116 Populating Next Right Pointers in Each Node 填充每个节点的下一个右侧节点指针 Medium 层序遍历
117 Populating Next Right Pointers in Each Node II 填充每个节点的下一个右侧节点指针 II Medium 层次遍历
118 Pascals Triangle 杨辉三角 Easy 嵌套循环
119 Pascals Triangle II 杨辉三角 II Easy 数组
120 Triangle 三角形最小路径和 Medium 动态规划
121 Best Time to Buy and Sell Stock 买卖股票的最佳时机 Easy 动态规划、遍历
122 Best Time to Buy and Sell Stock II 股票买卖的最佳时机 II Medium 贪心、动态规划
123 Best Time to Buy and Sell Stock III 股票买卖的最佳时机 III Hard 动态规划
124 Binary Tree Maximum Path Sum 二叉树中的最大路径和 Hard 二叉树、DFS
125 Is Palindrome 验证回文串 Easy 双指针
126 Word Ladder II 单词接龙 II Hard BFS、回溯
127 Word Ladder 单词接龙 Hard BFS
128 Longest Consecutive Sequence 最长连续序列 Medium 哈希
129 Sum Root to Leaf Numbers 求根到叶子节点数字之和 Medium 二叉树
130 Surrounded Regions 被围绕的区域 Medium DFS
131 Palindrome Partitioning 分隔回文串 Medium 回溯
132 Palindrome Partitioning II 分隔回文串II Hard 动态规划
133 Clone Graph 克隆图 Medium DFS
134 Gas Station 加油站 Medium 数组、贪心
135 Candy 分发糖果 Hard 贪心
136 Single Number 只出现一次的数字 Easy 异或
137 Single Number II 只出现一次的数字 II Medium 位运算
138 Copy List with Random Pointer 随机链表的复制 Medium 链表、哈希
139 Word Break 单词拆分 Medium 动态规划
140 Word Break II 单词拆分 II Hard 记忆化搜索、回溯
141 Linked List Cycle 环形链表 Easy 双指针、哈希
142 Linked List Cycle II 环形链表 II Medium 双指针、哈希
143 Reorder List 重排链表 Medium 双指针
144 Binary Tree Preorder Traversal 二叉树的前序遍历 Easy 二叉树、栈
145 Binary Tree Postorder Traversal 二叉树的后序遍历 Easy 二叉树、栈
146 LRU Cache LRU 缓存 Medium LRU
147 Insertion Sort List 对链表进行插入排序 Medium 链表、排序
148 Sort List 排序链表 Medium 链表、排序
149 Max Points on a Line 直线上最多的点 Hard 哈希
150 Evaluate Reverse Polish Notation 逆波兰表达式求值 Medium
151 Reverse Words in a String 反转字符串中的单词 Medium 双指针
152 Maximum Product Subarray 乘积最大子数组 Medium 动态规划
153 Find Minimum in Rotated Sorted Array 寻找旋转排序数组中的最小值 Medium 二分查找
155 Min Stack 最小栈 Easy 数组
160 Intersection of Two Linked List 相交链表 Easy 双指针
162 Find Peak Element 寻找峰值 Medium 二分查找
164 Maximum Gap 最大间距 Medium 桶排序
165 Compare Version Numbers 比较版本号 Easy 字符串
166 Fraction to Recurring Decimal 分数到小数 Medium 长除法
167 Two Sum II 两数之和 II Easy 双指针
168 Excel Sheet Column Title Excel 列表名称 Easy 数学方法
169 Majority Element 求众数 Easy Boyer-Moore 投票算法
171 Excel Sheet Column Number Excel 表列序号 Easy 字符串
172 Factorial Trailing Zeroes 阶乘后的零 Easy 数学
179 Largest Number 最大数 Medium 数组、排序
189 Rotate Array 旋转数组 Easy 数组
190 Reverse Bits 颠倒二进制位 Easy 位运算
191 Number of 1 Bits 位 1 的个数 Easy 位运算
198 House Robber 打家劫舍 Easy 动态规划
199 Binary Tree Right Side View 二叉树的右视图 Medium BFS
200 Number of Islands 岛屿数量 Medium 图、DFS
202 Happy Number 快乐数 Easy 双指针
203 Remove Linked List Elements 删除链表中的元素 Easy 链表
204 Count Primes 计数质数 Easy 厄拉多塞筛法
205 Isomorphic Strings 同构字符串 Easy 字符串
206 Reverse Linked List 反转链表 Easy 双指针、链表
207 Course Schedule 课程表 Medium 图、拓扑排序
208 Implement Tire (Prefix Tree) 实现Tire(前缀树) Medium 前缀树
210 Course Schedule II 课程表 II Medium BFS
212 Word Search II 单词搜索 II Hard 字典树、DFS
214 Shortest Palindrome 最短回文串 Hard KMP
215 Kth Largest Element in an Array 数组中的第 K 大元素 Medium 快速选择
216 Combination Sum III 组合总和 III Medium 空间枚举、DFS
217 Contains Duplicate 存在重复元素 Easy 哈希
218 The Skyline Problem 天际线问题 Hard 二分查找
219 Contains Nearby Duplicate II 存在重复元素 II Easy 哈希
220 Contains Nearby Duplicate III 存在重复元素 III Hard 桶排序
221 Maximal Square 最大正方形 Medium 动态规划
225 Implement Stack using Queues 用队列实现栈 Easy
226 Invert Binary Tree 翻转二叉树 Easy 二叉树
227 Basic Calculator II 基本计算器 II Medium
228 Summary Ranges 汇总区间 Easy 贪心
230 Kth Smallest Element in a BST 二叉搜索树中的第 K 小的元素 Medium 二叉树
231 Power of Two 2 的幂 Easy
232 Implement Queue using Stacks 用栈实现队列 Easy
233 Number of Digit One 数字 1 的个数 Hard
234 Palindrome Linked List 回文链表 Easy 双指针
235 Lowest Common Ancestor of a Binary Search Tree 二叉搜索树的最近公共祖先 Medium 二叉树
236 Lowest Common Ancestor of a Binary Tree 二叉树的最近公共祖先 Medium 二叉树
237 Delete Node in a Linked List 删除链表中的节点 Medium 链表
238 Product of Array Except Self 除自身以外数组的乘积 Medium 数组
239 Slide Window Maximum 滑动窗口最大值 Hard 子串
240 Search a 2D Matrix II 搜索二维矩阵 II Medium 二分查找
242 Valid Anagram 有效的字母异位词 Easy 字符串、哈希
257 Binary Tree Paths 二叉树的所有路径 Easy 回溯
258 Add Digits 各位相加 Easy 数学、递归
260 Single Number III 只出现一次的数字 III Medium 位运算
263 Ugly Number 丑数 Easy 数学
268 Missing Number 缺失数字 Easy
274 H-Index H 指数 Medium
278 First Bad Version 第一个错误的版本 Easy 二分查找
279 Perfect Squares 完全平方数 Medium 动态规划
283 Move Zeroes 移动零 Easy 双指针
287 Find the Duplicate Number 寻找重复数 Medium 布隆过滤
289 Game of Life 生命游戏 Medium 数组
290 Word Pattern 单词规律 Easy 字符串
292 Nim Game Nim 游戏 Easy 数学
295 Find Median from Data Stream 数据流的中位数 Hard
297 Serialize and Deserialize Binary Tree 二叉树的序列化与反序列化 Hard
300 Longest Increasing Subsequence 最长上升子序列 Medium
301 Remove Invalid Parentheses 删除无效的括号 Hard BFS
303 Range Sum Query-Immutable 区域和检索-数组不可变 Easy 数组
309 Best Time to Buy and Sell Stock with Cooldown 买卖股票的最佳时机含冷冻期 Medium 动态规划
310 Minimum Height Trees 最小高度树 Medium 队列
312 Burst Balloons 戳气球 Hard 动态规划
315 Count of Smallest Numbers After Self 计算右侧小于当前元素的个数 Hard 归并排序
319 Bulb Switcher 灯泡开关 Medium 数学
322 Coin Change 零钱兑换 Medium 动态规划
324 Wiggle Sort II 摆动排序 II Medium 排序
326 Power of Three 3 的幂 Easy
328 Odd Even Linked List 奇偶链表 Medium 链表
329 Longest Increasing Path in a Matrix 矩阵中的最长递增路径 Hard 记忆化搜索
332 Reconstruct Itinerary 重新安排行程 Hard DFS
334 Increasing Triplet Subsequence 递增的三元子序列 Medium 贪心、数组
337 House Robber III 打家劫舍 III Medium 动态规划
338 Counting Bits 比特位计数 Easy
341 Flatten Nested List Iterator 扁平化嵌套列表迭代器 Medium
342 Power of Four 4 的幂 Easy
343 Integer Break 整数拆分 Medium
344 Reverse String 反转字符串 Easy
345 Reverse Vowels of a String 翻转字符串中的元音字母 Easy 双指针
347 Top K Frequent Elements 前 K 个高频元素 Medium 桶排序
349 Intersection of Two Arrays 两个数组的交集 Easy
350 Intersection of Two Arrays II 两个数组的交集 II Easy
365 Water and Jug Problem 水壶问题 Medium 数学方法
371 Sum of Two Integers 两个整数相加 Easy 位运算
373 Find K Pairs with Smallest Sums 查找和最小的 K 对数字 Medium
374 Guess Number Higher or lower 猜数字大小 Easy 二分查找
377 Combination Sum IV 组合总和 Ⅳ Medium 动态规划、回溯
378 Kth Smallest Element in a Sorted Matrix 有序矩阵中第 K 小的元素 Medium 二分查找
380 Insert Delete GetRandom O1 O(1)时间插入删除和获取随机元素 Medium 哈希
381 Insert Delete GetRandom O(1) - Duplicates allowed O(1)时间插入删除和获取随机元素-允许重复 Hard 哈希
383 Ransom Note 赎金信 Easy 哈希表
384 Shuffle an Array 打乱数组 Medium 数组
387 First Unique Character in a String 字符串中的第一个唯一字符 Easy 哈希
389 Find The Difference 找不同 Easy
392 Is Subsequence 判断子序列 Easy 子串
394 Decode String 字符串解码 Medium
395 Longest Substring with At Least K Repeating Characters 至少有 K 个充数字符的最长子串 Medium 分治
399 Evaluate Division 除法求值 Medium 图、DFS
400 Find Nth Digit 第 N 个数字 Medium 字符串
405 Convert a Number to Hexadecimal 转 16 进制 Easy
406 Queue Reconstruction by Height 根据身高重建队列 Medium 数组
409 Longest Palindrome 最长回文串 Easy 贪心、字符串
412 Fizz Buzz Fizz Buzz Easy 字符串
414 Third Maximum Number 第三大的数 Easy
415 Add Strings 字符串相加 Easy 模拟
416 Partition Equal Subset Sum 分割等和子集 Medium 动态规划
435 Non-overlapping Intervals 无重叠区间 Medium 区间集合
437 Path Sum III 路径总和 III Medium 二叉树、DFS
438 Find All Anagrams in a String 找到字符串中所有字母异位词 Medium 滑动窗口
440 Kth Smallest in Lexicographical Order 字典序的第 K 小数字 Hard 字典树
441 Arranging Coins 排列硬币 Easy 二分查找
442 Find All Duplicates in an Array 数组中重复的数据 Medium 数组
443 String Compression 压缩字符串 Medium 字符串、双指针
447 Number of Boomerangs 回旋镖的数量 Medium 哈希
448 Find All Numbers Disappeared in an Array 找到所有数组中消失的数字 Easy
450 Delete Node in a BST 删除二叉搜索树中的节点 Medium 二叉搜索树
452 Minimum Number of Arrows to Burst Balloons 用最少数量的箭引爆气球 Medium 区间集合
454 4Sum II 四数相加 II Medium 哈希
455 Assign Cookies 分发饼干 Easy
456 132 Pattern 132 模式 Medium 枚举
458 Poor Pigs 可怜的小猪 Hard
459 Repeated Substring Pattern 重复的子字符串 Easy
461 Hamming Distance 汉明距离 Easy 位运算
462 Minimum Move to Equal Array Elements II 最小操作次数是数组元素相等II Medium 排序
463 Island Perimeter 岛屿的周长 Easy DFS
464 Can I Win 我能赢吗 Easy
485 Find Max Consecutive Ones 最大连续 1 的个数 Easy
486 Predict the Winner 预测赢家 Medium 动态规划
491 Non- decreasing Subsequence 递增子序列 Medium DFS
494 Target Sum 目标和 Medium 回溯
496 Next Greater Element I 下一个更大元素 I Easy 哈希
509 Fibonacci 斐波那契数 Easy
518 Coin Change II 零钱兑换 II Medium 动态规划
519 Random Flip Matrix 随机翻转矩阵 Medium 数组
529 Minesweeper 扫雷游戏 Medium
532 K-diff Pairs in an Array 数组中的 k-diff 数对 Medium 哈希
538 Convert BST to Greater Tree 把二叉搜索树转换为累加树 Medium 二叉树
541 Reverse String II 反转字符串 II Easy
543 Diameter of Binary Tree 二叉树的直径 Easy 二叉树
547 Number of Provinces 省份数量 Medium 图、DFS
551 Student Attendance Record I 学生出勤记录 I Easy
552 Student Attendance Record II 学生出勤记录 II Hard 动态规划
557 Reverse Words in a String III 反转字符串中的单词 III Easy 字符串
560 Subarray Sum Equals K 和为 k 的子数组 Medium 前缀和、哈希
561 Array Partition 数组拆分 Easy
581 Shortest Unsorted Continuous Subarray 最短无序连续子数组 Medium 双指针
589 N-ray Tree Preorder Traversal N叉树的前序遍历 Easy 二叉树
605 Can Place Flowers 种花问题 Easy 贪心
606 Construct String from Binary Tree 根据二叉树创建字符串 Easy
611 Valid Triangle Number 有效三角形的个数 Medium 排序、双指针
617 Merge Two Binary Tree 合并二叉树 Easy 二叉树
621 Task Scheduler 任务调度器 Medium
628 Maximum Product of Three Numbers 三个数的最大乘积 Easy 排序
642 Palindromic Substrings 设计搜索自动补全系统 Medium
643 Maximum Average Subarray I 子数组最大平均数 I Easy
647 Palindromic Substrings 回文子串 Medium Manacher 算法
649 Dota2 Senate Dota2 参议院 Medium 队列
653 Two Sum IV - Input is a BST 两数之和 IV - 输入二叉搜索树 Easy 二叉搜索树、DFS
657 Robot Return to Origin 机器人能否返回终点 Easy 数组
665 Non-decreasing Array 非递减数列 Easy
668 Kth Smallest Number in Multiplication Table 乘法表中的第 K 小的数 Hard
670 Maximum Swap 最大交换 Medium 贪心
680 Valid Palindrome II 验证回文串 II Easy
692 Top K Frequent Words 前K个高频单词 Medium 排序
700 Search in a Binary Search Tree 二叉搜索树中的搜索 Easy 二叉搜索树
703 Kth Largest Element in a Stream 数据流中的第 K 大元素 Easy
704 Binary Search 二分查找 Easy
709 To Lower Case 转换成小写字母 Easy
714 Best Time to Buy and Sell Stock with Transaction Fee 买卖股票的最佳时机含手续费 Medium 多维动态规划
720 Longest Word in Dictionary 词典中最长的单词 Easy 贪心、排序
724 Find Pivot Index 寻找数组的中心索引 Easy
735 Asteroid Collision 小行星碰撞 Medium
738 Monotone Increasing Digits 单调递增的数字 Medium 贪心
739 Daily Temperatures 每日温度 Medium 单调栈
746 Min Cost Climbing Stairs 使用最小花费爬楼梯 Easy 动态规划
747 Largest Number At Least Twice of Others 至少是其他数字两倍的最大数 Easy
763 Partition Labels 划分字母区间 Medium 贪心
767 Reorganize String 重构字符串 Medium 优先队列
778 Swim In Rising Water 水位上升的泳池中游泳 Hard
784 Letter Case Permutation 字母大小写全排列 Medium
790 Domino and Tromino Tiling 多米诺和托米诺平铺 Medium 一维动态规划
814 Binary Tree Pruning 二叉树剪枝 Medium
841 Keys and Rooms 钥匙和房间 Medium DFS
844 Backspace Sting Compare 比较含退格的字符串 Easy 双指针
845 Longest Mountain in Array 数组中最长的山脉 Medium 双指针
860 Lemonade Change 柠檬水找零 Easy 贪心
864 Shortest Path to Get All Keys 获取所有钥匙的最短路径 Hard BFS
867 Transpose Matrix 转置矩阵 Easy 模拟
872 Leaf-Similar Tree 叶子相似的树 Easy 二叉树、DFS
875 Koko Eating Banana 爱吃香蕉的珂珂 Medium 二分查找
901 Online Stock Span 股票价格跨度 Medium 单调栈
905 Sort Array By Parity 按奇偶排序数组 Easy 双指针
912 Sort an Array 排序数组 Medium 排序
929 Num Unique Emails 独特的电子邮件地址 Easy
933 Number of Recent Calls 最近的请求次数 Easy
941 Valid Mountain Array 有效的山脉数组 Easy
942 DI String Match 增减字符串匹配 Easy
946 Validate Stack Sequences 验证栈序列 Medium
953 Verifying an Alien Dictionary 验证外星语词典 Easy
965 Univalued Binary Tree 单值二叉树 Easy
973 K Closest Points to Origin 最接近原点的 K 个点 Medium 排序
974 Subarray Sums Divisible by K 和可被 K 整除的子数组 Medium
977 Squares of a Sorted Array 有序数组的平方 Easy 双指针
989 Add to Array-Form of Integer 数组形式的整数加法 Easy
994 Rotting Oranges 腐烂的橘子 Medium 图、BFS
1002 Find Common Characters 查找常用字符 Easy
1004 Max Consecutive Ones III 最大连续1的个数 III Medium 滑动窗口
1021 Remove Outer Parentheses 删除最外层的括号 Easy
1022 Sum of Root To Leaf Binary Numbers 从根到叶的二进制数之和 Easy
1053 Previous Permutation With One Swap 交换一次的先前排列 Medium 数组
1071 Greatest Common Divisor of Strings 字符串的最大公因子 Easy 字符串、GCD
1108 Defanging an Ip Address IP 地址无效化 Easy 字符串
1122 Relative Sort Array 数组的相对排序 Easy
1128 Number of Equivalent Domino Pairs 等价多米诺骨牌对的数量 Easy 数组
1137 N-th Tribonacci Number 第 N 个泰波那契数 Easy
1143 Longest Common Subsequence 最长公共子序列 Medium
1161 Maximum Level Sum of a Binary Tree 最大层内元素和 Medium 二叉树、BFS
1186 Maximum Subarray Sum with One Deletion 删除一次得到子数组最大和 Medium 动态规划
1191 K-Concatenation Maximum Sum K 次串联后最大子数组之和 Medium Kadane 算法
1200 Minimum Abs Difference 最小绝对差 Easy
1207 Unique Number of Occurrences 独一无二的出现次数 Easy 哈希
1217 Minimum Cost to Move Chips to The Same Position 玩筹码 Easy
1227 Airplane Seat Assignment Probability 飞机座位分配概率 Medium 数学
1260 Shift 2D Grid 二维网格迁移 Easy
1268 Search Suggestion System 搜索推荐系统 Medium 前缀树
1289 Minimum Falling Path Sum II 下降路径最小和 II Hard
1318 Minimum Flips to Make a OR b Equal to c 或运算的最小翻转次数 Medium 位运算
1356 Sort Integers by The Number of 1 Bits 根据数字二进制下1的数目排序 Easy 位运算
1365 How Many Numbers Are Smaller Than the Current Number 有多少小于当前数字的数字 Easy
1370 Increasing Decreasing String 上升下降字符串 Easy 桶计数
1372 Longest ZigZag Path in a Binary Tree 二叉树中的最长交错路径 Medium 二叉树、DFS
1388 Pizza With 3n Slices 3n 块披萨 Hard
1403 Minimum Subsequence in Non-Increasing Order 非递增顺序的最小子序列 Easy 贪心
1413 Minimum Value to Get Positive Step by Step Sum 逐步求和得到正数的最小值 Easy
1431 Kids With the Greatest Number of Candies 拥有最多糖果的孩子 Easy
1446 Consecutive Characters 连续字符 Easy 数组
1448 Count Good Nodes in Binary Tree 统计二叉树中好节点的数目 Medium 二叉树、DFS
1451 Rearrange Words in a Sentence 重新排列句子中的单词 Medium 字符串
1456 Maximum Number of Vowels in a Substring of Given Length 定长子串中元音的最大数目 Medium 滑动窗口
1466 Reorder Routes to Make All Paths Lead to the City Zero 重新规划路线 Medium 图、DFS
1470 Shuffle the Array 重新排列数组 Easy 数组
1493 Longest Subarray of 1’s After Deleting One Element 删掉一个元素以后全为1的最长子数组 Medium 滑动窗口
1518 Water Bottles 换水问题 Easy 数学方法
1528 Shuffle String 重新排列字符串 Easy 数组
1572 Matrix Diagonal Sum 矩阵对角线的元素和 Easy
1576 Replace All ?‘s to Avoid Consecutive Repeating Characters 替换所有的问号 Easy 数组
1640 Check Array Formation Through Concatenation 能否连接成数组 Easy
1652 Defuse the Bomb 拆炸弹 Easy 滑动窗口
1657 Determine if Two Strings Are Close 确定两个字符串是否接近 Medium 哈希
1679 Max Number of K-Sum Pairs K 和数对的最大数目 Medium 双指针
1726 Tuple with Same Product 同积元组 Medium 哈希
1732 Find the Highest Altitude 找到最高海拔 Easy 前缀和
1768 Merge String Alternatively 交替合并字符串 Easy 字符串
1823 Find The Winner 找出游戏的获胜者 Medium
1926 Nearest Exit from Entrance in Maze 迷宫中离入口最近的出口 Medium 图、BFS
1945 Sum of Digits of String After Convert 字符串转化后的各位数字之和 Easy
2028 Find Missing Observations 找出缺失的观测数据 Medium 数学方法
2038 Remove Colored Pieces if Both Neighbors are the Same Color 如果相邻两个颜色均相同则删除当前颜色 Medium
2095 Delete the Middle Node of a Linked List 删除链表的中间节点 Medium 链表、双指针
2130 Maximum Twin Sum of a Linked List 链表最大孪生和 Medium 链表、双指针
2215 Find the Difference of Two Arrays 找出两数组的不同 Easy 哈希
2300 Successful Pairs of Spells and Potions 咒语和药水的成功对数 Medium 二分查找
2336 Smallest Number in infinite Set 无限集中的最小数字 Medium 优先队列
2352 Equal Row and Column Pairs 相等行列对 Medium 哈希
2390 Removing Stars From a String 从字符串中移除星号 Medium
2462 Total Cost to Hire K Workers 雇佣 K 位工人的总代价 Medium 优先队列
2512 Reward Top K Students 奖励最顶尖的 K 名学生 Medium 排序
2530 Maximal Score After Applying K Operations 执行 K 次操作后的最大分数 Medium 贪心、优先队列
2542 Maximum Subsequence Score 最大子序列的分数 Medium 优先队列、滑动窗口
2578 Split With Minimum Sum 最小和分割 Easy 贪心
2580 Count Ways to Group Overlapping Ranges 统计将重叠区间合并成组的方案数 Medium 区间合并
2639 Find the Width of Columns of a Grid 查询网格图中每一列的宽度 Easy 数组
2652 Sum Multiples 倍数求和 Easy 数学方法
2697 Lexicographically Smallest Palindrome 字典序最小回文串 Easy 双指针
2731 Movement of Robots 移动机器人 Medium 脑筋急转弯
2760 Longest Even Odd Subarray With Threshold 最长奇偶子数组 Easy 动态规划
3033 Modify the Matrix 修改矩阵 Easy 数组
3146 Permutation Difference between Two Strings 两个字符串的排列差 Easy 哈希

剑指offer

Number Name Difficulty label
03 数组中重复的数字 Easy 哈希
04 二维数组中的查找 Medium
05 替换空格 Easy
06 从尾到头打印链表 Easy
07 重建二叉树 Medium
09 用两个栈实现队列 Easy
10(1) 斐波那契数列 Easy
10(2) 青蛙跳台阶问题 Easy
11 旋转数组的最小数字 Easy
12 矩阵中的路径 Medium
13 机器人的运动范围 Medium
14(1) 剪绳子 Medium
14(2) 剪绳子II Medium
15 二进制中1的个数 Easy
16 数值的整数次方 Medium
17 打印从1到最大的n位数 Easy
18 删除链表的节点 Easy
19 正则表达式匹配 Hard
20 表示数值的字符串 Medium
21 调整数组顺序使奇数位于偶数前面 Easy
22 链表中倒数第k个节点 Easy
24 反转链表 Easy
25 合并两个排序的链表 Easy
26 树的子结构 Medium
27 二叉树的镜像 Easy
28 对称的二叉树 Easy
29 顺时针打印矩阵 Easy
30 包含min函数的栈 Easy
31 栈的压入、弹出序列 Medium
32(1) 从上到下打印二叉树 Medium
32(2) 从上到下打印二叉树II Easy
32(3) 从上到下打印二叉树III Medium
33 二叉搜索树的后序遍历序列 Medium
34 二叉树中和为某一值的路径 Medium
35 复杂链表的复制 Medium
36 二叉搜索树与双向链表 Medium
37 序列化二叉树 Hard
38 字符串的排列 Medium
39 数组中出现次数超过一半的数字 Easy
40 最小的k个数 Easy
41 数据流中的中位数 Hard
42 连续子数组的最大和 Easy
43 1~n整数中1出现的次数 Medium
44 数字序列中某一位的数字 Medium
45 把数组排成最小的数 Medium
46 把数字翻译成字符串 Medium
47 礼物的最大价值 Medium
48 最长不含重复字符的子字符串 Medium
49 丑数 Medium
50 第一个只出现一次的字符 Easy
51 数组中的逆序对 Hard
52 两个链表的第一个公共节点 Easy
53(1) 在排序数组中查找数字I Easy
53(2) 0至n➖1中缺失的数字 Easy
54 二叉搜索树的第k大节点 Easy
55(1) 二叉树的深度 Easy
55(2) 平衡二叉树 Easy
56(1) 数组中数字出现的次数 Medium
56(2) 数组中数字出现的次数II Medium
57(2) 和为s的连续正数序列 Easy
57 和为s的两个数字 Easy
58(2) 左旋转字符串 Easy
58 翻转单词顺序 Easy
59 滑动窗口的最大值 Easy
60 n个骰子的点数 Easy
62 圆圈中最后剩下的数字 Easy
63 股票的最大利润 Medium
64 求1+2+…+n Medium
65 不用加减乘除做加法 Easy
66 构建乘积数组 Easy
67 把字符串转换成整数 Medium
68(2) 二叉树的最近公共祖先 Easy
68 二叉搜索树的最近公共祖先 Easy

About

使用JavaScript来刷LeetCode~~

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published