洗刷刷

2022/5/8

some exercises of leetcode

Number Name Difficulty
1 Two Sum 两数之和 (opens new window) Easy
2 Add Two Numbers 两数相加 (opens new window) Medium
3 Longest Substring Without Repeating Characters 无重复字符的最长子串 (opens new window) Medium
4 Median of Two Sorted Arrays 两个排序数组的中位数 (opens new window) Hard
5 Longest Palindromic Substring 最长回文子串 (opens new window) Medium
6 ZigZag Converesion Z 字形变换 (opens new window) Medium
7 Reverse Integer 翻转整数 (opens new window) Easy
8 String to Integer (atoi) 字符串转为整数 (opens new window) Medium
9 Palindrome Number 回文数字 (opens new window) Easy
10 Regular Expression Matching 正则表达式匹配 (opens new window) Hard
11 Container With Most Water 盛最多水的容器 (opens new window) Medium
12 Integer to Roman 整数转罗马数字 (opens new window) Medium
13 Roman to Integer 罗马数字转整数 (opens new window) Easy
14 Longest Common Prefix 最长共同前缀 (opens new window) Easy
15 3Sum 三数之和 (opens new window) Medium
16 3Sum Closest 最接近的三数之和 (opens new window) Medium
17 Letter Combinations of a PhoneNumber 电话号码的字母组合 (opens new window) Medium
18 4Sum 四数之和 (opens new window) Medium
19 Remove Nth Node From End of List 删除链表的倒数第 N 个节点 (opens new window) Medium
20 Valid Parentheses 有效的括号 (opens new window) Easy
21 Merge Two Sorted Lists 合并两个有序链表 (opens new window) Easy
22 Generate Parentheses 生成括号 (opens new window) Medium
23 Merge k Sorted Lists 合并 K 个排序链表 (opens new window) Hard
24 Swap Nodes In Pairs 两两交换链表中的节点 (opens new window) Medium
25 Reverse Nodes in k-Group 每 k 个一组翻转链表 (opens new window) Hard
26 Remove Duplicates from Sorted Array 从有序数组中删除重复项 (opens new window) Easy
27 Remove Element 移除元素 (opens new window) Easy
28 Implement strStr() 实现 strStr() (opens new window) Easy
29 Divide Two Integers 两数相除 (opens new window) Medium
30 Substring with Concatenation of All Words 串联所有单词的子串 (opens new window) Hard
31 Next-permutation 下一个排列 (opens new window) Medium
32 Longest Valid Parentheses 最长有效括号 (opens new window) Hard
33 Search in Rotated Sorted Array 在旋转有序数组中搜索 (opens new window) Medium
34 Search for a Range 搜索范围 (opens new window) Medium
35 Search Insert Position 搜索插入位置 (opens new window) Easy
36 Valid Sudoku 验证数独 (opens new window) Medium
37 Sudoku Solver 解数独 (opens new window) Hard
38 Count and Say 数数并说 (opens new window) Easy
39 CombinationSum 组合之和 (opens new window) Medium
40 CombinationSumII 组合之和 (opens new window) Medium
41 First Missing Positive 缺失的第一个正数 (opens new window) Hard
42 Trapping Rain Water 接雨水 (opens new window) Hard
43 Maximum Subarray 最大子序和 (opens new window) Medium
44 Wildcard Matching 通配符匹配 (opens new window) Hard
45 Jump Game II 跳跃游戏 II (opens new window) Hard
46 Permutations 全排列 (opens new window) Medium
47 PermutationsII 全排列 II (opens new window) Medium
48 Rotate Image 旋转图像 (opens new window) Medium
49 Group Anagrams 字母异位词分组 (opens new window) Medium
50 Pow(x, n) Pow(x, n) (opens new window) Medium
51 N-Queens N 皇后 (opens new window) Hard
52 N-Queens II N 皇后 2 (opens new window) Hard
53 Multiply String 字符串相乘 (opens new window) Medium
54 Spiral Matrix 螺旋矩阵 (opens new window) Medium
55 Jump Game 跳跃游戏 (opens new window) Medium
56 Merge Intervals 合并区间 (opens new window) Medium
57 Insert Interval 插入区间 (opens new window) Hard
58 Length of Last Word 最后一个单词的长度 (opens new window) Easy
59 Spiral Matrix II 螺旋矩阵 II (opens new window) Medium
60 Permutation Sequence 第 k 个排列 (opens new window) Medium
61 Rotate List 旋转链表 (opens new window) Medium
62 Unique Paths 不同路径 (opens new window) Medium
63 Unique Paths II 不同路径 2 (opens new window) Medium
64 Minimum Path Sum 最小路径和 (opens new window) Medium
65 Valid Number 有效数字 (opens new window) Hard
66 Plus One 加一 (opens new window) Easy
67 Add Binary 二进制求和 (opens new window) Easy
68 Text Justification 文本左右对齐 (opens new window) Hard
69 Sqrt(x) x 的平方根 (opens new window) Easy
70 Climbing Stairs 爬楼梯 (opens new window) Easy
71 SimplifyPath 简化路径 (opens new window) Medium
72 Edit Distance 编辑距离 (opens new window) Hard
73 Set Matrix Zeroes 矩阵置零 (opens new window) Medium
74 Search a 2D Matrix 搜索二维矩阵 (opens new window) Medium
75 Sort Colors 颜色分类 (opens new window) Medium
77 Combinations 组合 (opens new window) Medium
78 Subsets 子集 (opens new window) Medium
80 Remove Duplicates from Sorted Array II 删除排序数组中的重复项 II (opens new window) Medium
83 Remove Duplicates from Sorted List 删除排序链表中的重复元素 (opens new window) Easy
84 Largest Rectangle in Histogram 柱状图中最大的矩形 (opens new window) Hard
85 Maximal Rectangle 最大矩形 (opens new window) Hard
88 Merge Sorted Array 合并两个有序数组 (opens new window) Easy
94 Binary Tree Inorder Traversal 二叉树的中序遍历 (opens new window) Medium
100 Same Tree 相同的树 (opens new window) Easy
105 Construct Binary Tree from Preorderand Inorder Traversal 从前序与中序遍历序列构造二叉树 (opens new window) Medium
107 Binary Tree Level Order Traversal II 二叉树的层次遍历 II (opens new window) Easy
109 Convert Sorted Array to Binary Search Tree 将有序数组转换为二叉搜索树 (opens new window) Medium
110 Balanced Binary Tree 平衡二叉树 (opens new window) Easy
111 Minimum Depth of Binary Tree 二叉树的最小深度 (opens new window) Easy
112 Path Sum 路径总和 (opens new window) Easy
118 Pascals Triangle 杨辉三角 (opens new window) Easy
119 Pascals Triangle ii 杨辉三角 2 (opens new window) Easy
125 IsPalindrome 验证回文串 (opens new window) Easy
129 Sum Root to Leaf Numbers 求根到叶子节点数字之和 (opens new window) Medium
136 SingleNumber 只出现一次的数字 (opens new window) Easy
141 Linked List Cycle 环形链表 (opens new window) Easy
155 MinStack 最小栈 (opens new window) Easy
165 Compare Version Numbers 比较版本号 (opens new window) Easy
167 TwoSum-II 两数之和 II - 输入有序数组 (opens new window) Easy
169 MajorityElement 求众数 (opens new window) Easy
171 Excel Sheet Column Number Excel 表列序号 (opens new window) Easy
172 Factorial Trailing Zeroes 阶乘后的零 (opens new window) Easy
189 RotateArray 旋转数组 (opens new window) Easy
190 ReverseBits 颠倒二进制位 (opens new window) Easy
191 HammingWeight 颠倒二进制位 (opens new window) Easy
198 House Robber 打家劫舍 (opens new window) Easy
199 Binary Tree Right Side View 二叉树的右视图 (opens new window) Medium
202 Happy Number 快乐数 (opens new window) Easy
203 Remove Linked List Elements 删除链表中的元素 (opens new window) Easy
204 Count Primes 计数质数 (opens new window) Easy
205 Isomorphic Strings 同构字符串 (opens new window) Easy
206 Reverse Linked List 反转链表 (opens new window) Easy
217 ContainsDuplicate 存在重复元素 (opens new window) Easy
219 ContainsNearbyDuplicate 存在重复元素 II (opens new window) Easy
225 Implement Stack using Queues 用队列实现栈 (opens new window) Easy
231 IsPowerOfTwo 2 的幂 (opens new window) Easy
232 Implement Queue using Stacks 用栈实现队列 (opens new window) Easy
238 Product of Array Except Self 除自身以外数组的乘积 (opens new window) Medium
242 Valid Anagram 有效的字母异位词 (opens new window) Easy
257 Binary Tree Paths 二叉树的所有路径 (opens new window) Easy
258 Add Digits 各位相加 (opens new window) Easy
263 Ugly Number 丑数 (opens new window) Easy
268 MissingNumber 缺失数字 (opens new window) Easy
278 First Bad Version 第一个错误的版本 (opens new window) Easy
283 MoveZeroes 移动零 (opens new window) Easy
287 Word Pattern 单词规律 (opens new window) Medium
290 Word Pattern 单词规律 (opens new window) Easy
300 Longest Increasing Subsequence 最长上升子序列 (opens new window) Medium
303 Range Sum Query-Immutable 区域和检索 - 数组不可变 (opens new window) Easy
326 IsPowerOfThree 3 的幂 (opens new window) Easy
342 IsPowerOfFour 4 的幂 (opens new window) Easy
344 ReverseString 反转字符串 (opens new window) Easy
349 Intersection of Two Arrays 两个数组的交集 (opens new window) Easy
350 Intersection of Two ArraysII 两个数组的交集 (opens new window) Easy
371 Sum of Two Integers 两个整数相加 (opens new window) Easy
377 Combination Sum IV 组合总和 Ⅳ (opens new window) Medium
383 Ransom Note 赎金信 (opens new window) Easy
387 FirstUniqChar 字符串中的第一个唯一字符 (opens new window) Easy
389 FindTheDifference 找不同 (opens new window) Easy
392 Is Subsequence 判断子序列 (opens new window) Easy
400 Find Nth Digit 第 N 个数字 (opens new window) Easy
405 ToHex 转 16 进制 (opens new window) Easy
414 ThirdMax 转 16 进制 (opens new window) Easy
448 Find All Numbers Disappeared in an Array 找到所有数组中消失的数字 (opens new window) Easy
455 Assign Cookies 分发饼干 (opens new window) Easy
459 Repeated Substring Pattern 重复的子字符串 (opens new window) Easy
485 Find Max Consecutive Ones 最大连续 1 的个数 (opens new window) Easy
509 Fibonacci 斐波那契数 (opens new window) Easy
541 Reverse String II 反转字符串 II (opens new window) Easy
561 ArrayPairSum 数组拆分 I (opens new window) Easy
581 Shortest Unsorted Continuous Subarray 最短无序连续子数组 (opens new window) Easy
606 Construct String from Binary Tree 根据二叉树创建字符串 (opens new window) Easy
628 MaximumProduct 三个数的最大乘积 (opens new window) Easy
643 FindMaxAverage 子数组最大平均数 I (opens new window) Easy
653 Two Sum IV - Input is a BST 两数之和 IV - 输入 BST (opens new window) Easy
703 Kth Largest Element in a Stream 数据流中的第 K 大元素 (opens new window) Easy
704 Binary Search 二分查找 (opens new window) Easy
709 ToLowerCase 转换成小写字母 (opens new window) Easy
720 Longest Word in Dictionary 词典中最长的单词 (opens new window) Easy
724 FindPivotIndex 寻找数组的中心索引 (opens new window) Easy
746 Min Cost Climbing Stairs 使用最小花费爬楼梯 (opens new window) Easy
747 DominantIndex 至少是其他数字两倍的最大数 (opens new window) Easy
905 SortArrayByParity 按奇偶排序数组 (opens new window) Easy
907 SortedSquares 有序数组的平方 (opens new window) Easy
933 Number of Recent Calls 最近的请求次数 (opens new window) Easy
942 DI String Match 增减字符串匹配 (opens new window) Easy
989 AddToArrayForm 数组形式的整数加法 (opens new window) Easy
994 Rotting Oranges 腐烂的橘子 (opens new window) Easy
1002 CommonChars 查找常用字符 (opens new window) Easy
1122 Relative Sort Array 数组的相对排序 (opens new window) Easy
1137 N-th Tribonacci Number 第 N 个泰波那契数 (opens new window) Easy
1365 How Many Numbers Are Smaller Than the Current Number 有多少小于当前数字的数字 (opens new window) Easy
1431 Kids With the Greatest Number of Candies 拥有最多糖果的孩子 (opens new window) Easy
1945 Sum of Digits of String After Convert 字符串转化后的各位数字之和 (opens new window) Easy
2038 Remove Colored Pieces if Both Neighbors are the Same Color 如果相邻两个颜色均相同则删除当前颜色 (opens new window) Easy

# 剑指 Offer

Number Name Difficulty
10 - I 斐波那契数列 (opens new window) Easy
22 链表中倒数第 k 个节点 (opens new window) Easy