File tree
486 files changed
+1462
-883
lines changed- basic/sorting/MergeSort
- lcci
- 01.01.Is Unique
- 01.06.Compress String
- 01.08.Zero Matrix
- 02.01.Remove Duplicate Node
- 02.02.Kth Node From End of List
- 02.03.Delete Middle Node
- 02.04.Partition List
- 02.05.Sum Lists
- 02.06.Palindrome Linked List
- 02.07.Intersection of Two Linked Lists
- 02.08.Linked List Cycle
- 03.01.Three in One
- 03.02.Min Stack
- 03.04.Implement Queue using Stacks
- 03.05.Sort of Stacks
- 03.06.Animal Shelter
- 04.02.Minimum Height Tree
- 04.04.Check Balance
- 04.05.Legal Binary Search Tree
- 04.06.Successor
- 04.08.First Common Ancestor
- 04.10.Check SubTree
- 04.12.Paths with Sum
- 08.01.Three Steps Problem
- 08.10.Color Fill
- 08.12.Eight Queens
- 16.02.Words Frequency
- 16.10.Living People
- 16.25.LRU Cache
- 17.05.Find Longest Subarray
- 17.07.Baby Names
- 17.10.Find Majority Element
- 17.12.BiNode
- 17.16.The Masseuse
- 17.19.Missing Two
- 17.20.Continuous Median
- 17.21.Volume of Histogram
- 17.22.Word Transformer
- lcof
- 面试题06. 从尾到头打印链表
- 面试题07. 重建二叉树
- 面试题09. 用两个栈实现队列
- 面试题10- I. 斐波那契数列
- 面试题12. 矩阵中的路径
- 面试题13. 机器人的运动范围
- 面试题14- II. 剪绳子 II
- 面试题17. 打印从1到最大的n位数
- 面试题20. 表示数值的字符串
- 面试题21. 调整数组顺序使奇数位于偶数前面
- 面试题22. 链表中倒数第k个节点
- 面试题24. 反转链表
- 面试题25. 合并两个排序的链表
- 面试题26. 树的子结构
- 面试题27. 二叉树的镜像
- 面试题28. 对称的二叉树
- 面试题29. 顺时针打印矩阵
- 面试题30. 包含min函数的栈
- 面试题32 - I. 从上到下打印二叉树
- 面试题32 - II. 从上到下打印二叉树 II
- 面试题32 - III. 从上到下打印二叉树 III
- 面试题34. 二叉树中和为某一值的路径
- 面试题35. 复杂链表的复制
- 面试题36. 二叉搜索树与双向链表
- 面试题37. 序列化二叉树
- 面试题38. 字符串的排列
- 面试题39. 数组中出现次数超过一半的数字
- 面试题40. 最小的k个数
- 面试题41. 数据流中的中位数
- 面试题43. 1~n整数中1出现的次数
- 面试题44. 数字序列中某一位的数字
- 面试题45. 把数组排成最小的数
- 面试题46. 把数字翻译成字符串
- 面试题51. 数组中的逆序对
- 面试题52. 两个链表的第一个公共节点
- 面试题53 - II. 0~n-1中缺失的数字
- 面试题54. 二叉搜索树的第k大节点
- 面试题55 - I. 二叉树的深度
- 面试题55 - II. 平衡二叉树
- 面试题56 - I. 数组中数字出现的次数
- 面试题56 - II. 数组中数字出现的次数 II
- 面试题57 - II. 和为s的连续正数序列
- 面试题58 - I. 翻转单词顺序
- 面试题59 - II. 队列的最大值
- 面试题60. n个骰子的点数
- 面试题61. 扑克牌中的顺子
- 面试题63. 股票的最大利润
- 面试题64. 求1+2+…+n
- 面试题65. 不用加减乘除做加法
- 面试题66. 构建乘积数组
- 面试题67. 把字符串转换成整数
- 面试题68 - I. 二叉搜索树的最近公共祖先
- 面试题68 - II. 二叉树的最近公共祖先
- lcof2
- 剑指 Offer II 007. 数组中和为 0 的三个数
- 剑指 Offer II 009. 乘积小于 K 的子数组
- 剑指 Offer II 013. 二维子矩阵的和
- 剑指 Offer II 014. 字符串中的变位词
- 剑指 Offer II 015. 字符串中的所有变位词
- 剑指 Offer II 017. 含有所有字符的最短字符串
- 剑指 Offer II 022. 链表中环的入口节点
- 剑指 Offer II 023. 两个链表的第一个重合节点
- 剑指 Offer II 024. 反转链表
- 剑指 Offer II 028. 展平多级双向链表
- 剑指 Offer II 029. 排序的循环链表
- 剑指 Offer II 031. 最近最少使用缓存
- 剑指 Offer II 034. 外星语言是否排序
- 剑指 Offer II 041. 滑动窗口的平均值
- 剑指 Offer II 042. 最近请求次数
- 剑指 Offer II 043. 往完全二叉树添加节点
- 剑指 Offer II 048. 序列化与反序列化二叉树
- 剑指 Offer II 053. 二叉搜索树中的中序后继
- 剑指 Offer II 055. 二叉搜索树迭代器
- 剑指 Offer II 058. 日程表
- 剑指 Offer II 059. 数据流的第 K 大数值
- 剑指 Offer II 061. 和最小的 k 个数对
- 剑指 Offer II 062. 实现前缀树
- 剑指 Offer II 064. 神奇的字典
- 剑指 Offer II 066. 单词之和
- 剑指 Offer II 071. 按权重生成随机数
- 剑指 Offer II 078. 合并排序链表
- 剑指 Offer II 079. 所有子集
- 剑指 Offer II 080. 含有 k 个元素的组合
- 剑指 Offer II 086. 分割回文子字符串
- 剑指 Offer II 092. 翻转字符
- 剑指 Offer II 096. 字符串交织
- 剑指 Offer II 105. 岛屿的最大面积
- 剑指 Offer II 111. 计算除法
- lcp
- LCP 28. 采购方案
- lcs/LCS 03. 主题空间
- solution
- 0000-0099
- 0004.Median of Two Sorted Arrays
- 0005.Longest Palindromic Substring
- 0006.ZigZag Conversion
- 0007.Reverse Integer
- 0008.String to Integer (atoi)
- 0012.Integer to Roman
- 0013.Roman to Integer
- 0021.Merge Two Sorted Lists
- 0023.Merge k Sorted Lists
- 0028.Implement strStr()
- 0032.Longest Valid Parentheses
- 0036.Valid Sudoku
- 0041.First Missing Positive
- 0042.Trapping Rain Water
- 0051.N-Queens
- 0054.Spiral Matrix
- 0057.Insert Interval
- 0061.Rotate List
- 0065.Valid Number
- 0070.Climbing Stairs
- 0072.Edit Distance
- 0077.Combinations
- 0078.Subsets
- 0079.Word Search
- 0090.Subsets II
- 0094.Binary Tree Inorder Traversal
- 0097.Interleaving String
- 0099.Recover Binary Search Tree
- 0100-0199
- 0105.Construct Binary Tree from Preorder and Inorder Traversal
- 0106.Construct Binary Tree from Inorder and Postorder Traversal
- 0108.Convert Sorted Array to Binary Search Tree
- 0109.Convert Sorted List to Binary Search Tree
- 0110.Balanced Binary Tree
- 0112.Path Sum
- 0131.Palindrome Partitioning
- 0138.Copy List with Random Pointer
- 0141.Linked List Cycle
- 0142.Linked List Cycle II
- 0143.Reorder List
- 0146.Lru Cache
- 0147.Insertion Sort List
- 0155.Min Stack
- 0160.Intersection of Two Linked Lists
- 0169.Majority Element
- 0170.Two Sum III - Data structure design
- 0173.Binary Search Tree Iterator
- 0179.Largest Number
- 0186.Reverse Words in a String II
- 0187.Repeated DNA Sequences
- 0188.Best Time to Buy and Sell Stock IV
- 0190.Reverse Bits
- 0200-0299
- 0202.Happy Number
- 0203.Remove Linked List Elements
- 0206.Reverse Linked List
- 0208.Implement Trie (Prefix Tree)
- 0211.Design Add and Search Words Data Structure
- 0213.House Robber II
- 0222.Count Complete Tree Nodes
- 0223.Rectangle Area
- 0225.Implement Stack using Queues
- 0232.Implement Queue using Stacks
- 0233.Number of Digit One
- 0235.Lowest Common Ancestor of a Binary Search Tree
- 0236.Lowest Common Ancestor of a Binary Tree
- 0237.Delete Node in a Linked List
- 0244.Shortest Word Distance II
- 0246.Strobogrammatic Number
- 0251.Flatten 2D Vector
- 0259.3Sum Smaller
- 0261.Graph Valid Tree
- 0268.Missing Number
- 0273.Integer to English Words
- 0278.First Bad Version
- 0280.Wiggle Sort
- 0281.Zigzag Iterator
- 0282.Expression Add Operators
- 0284.Peeking Iterator
- 0285.Inorder Successor in BST
- 0286.Walls and Gates
- 0288.Unique Word Abbreviation
- 0289.Game of Life
- 0293.Flip Game
- 0297.Serialize and Deserialize Binary Tree
- 0300-0399
- 0303.Range Sum Query - Immutable
- 0304.Range Sum Query 2D - Immutable
- 0306.Additive Number
- 0312.Burst Balloons
- 0317.Shortest Distance from All Buildings
- 0320.Generalized Abbreviation
- 0334.Increasing Triplet Subsequence
- 0335.Self Crossing
- 0339.Nested List Weight Sum
- 0341.Flatten Nested List Iterator
- 0342.Power of Four
- 0346.Moving Average from Data Stream
- 0348.Design Tic-Tac-Toe
- 0352.Data Stream as Disjoint Intervals
- 0355.Design Twitter
- 0359.Logger Rate Limiter
- 0360.Sort Transformed Array
- 0362.Design Hit Counter
- 0364.Nested List Weight Sum II
- 0365.Water and Jug Problem
- 0371.Sum of Two Integers
- 0373.Find K Pairs with Smallest Sums
- 0374.Guess Number Higher or Lower
- 0378.Kth Smallest Element in a Sorted Matrix
- 0379.Design Phone Directory
- 0380.Insert Delete GetRandom O(1)
- 0381.Insert Delete GetRandom O(1) - Duplicates allowed
- 0382.Linked List Random Node
- 0384.Shuffle an Array
- 0398.Random Pick Index
- 0399.Evaluate Division
- 0400-0499
- 0401.Binary Watch
- 0403.Frog Jump
- 0404.Sum of Left Leaves
- 0405.Convert a Number to Hexadecimal
- 0407.Trapping Rain Water II
- 0415.Add Strings
- 0417.Pacific Atlantic Water Flow
- 0419.Battleships in a Board
- 0430.Flatten a Multilevel Doubly Linked List
- 0433.Minimum Genetic Mutation
- 0436.Find Right Interval
- 0447.Number of Boomerangs
- 0449.Serialize and Deserialize BST
- 0454.4Sum II
- 0457.Circular Array Loop
- 0463.Island Perimeter
- 0472.Concatenated Words
- 0475.Heaters
- 0487.Max Consecutive Ones II
- 0489.Robot Room Cleaner
- 0490.The Maze
- 0493.Reverse Pairs
- 0497.Random Point in Non-overlapping Rectangles
- 0499.The Maze III
- 0500-0599
- 0505.The Maze II
- 0519.Random Flip Matrix
- 0528.Random Pick with Weight
- 0530.Minimum Absolute Difference in BST
- 0533.Lonely Pixel II
- 0535.Encode and Decode TinyURL
- 0536.Construct Binary Tree from String
- 0541.Reverse String II
- 0545.Boundary of Binary Tree
- 0563.Binary Tree Tilt
- 0572.Subtree of Another Tree
- 0600-0699
- 0605.Can Place Flowers
- 0622.Design Circular Queue
- 0628.Maximum Product of Three Numbers
- 0638.Shopping Offers
- 0641.Design Circular Deque
- 0643.Maximum Average Subarray I
- 0645.Set Mismatch
- 0652.Find Duplicate Subtrees
- 0654.Maximum Binary Tree
- 0665.Non-decreasing Array
- 0669.Trim a Binary Search Tree
- 0670.Maximum Swap
- 0676.Implement Magic Dictionary
- 0677.Map Sum Pairs
- 0690.Employee Importance
- 0695.Max Area of Island
- 0700-0799
- 0700.Search in a Binary Search Tree
- 0702.Search in a Sorted Array of Unknown Size
- 0703.Kth Largest Element in a Stream
- 0705.Design HashSet
- 0706.Design HashMap
- 0707.Design Linked List
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
486 files changed
+1462
-883
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
| 26 | + | |
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 |
| - | |
| 8 | + | |
9 | 9 |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
13 |
| - | |
| 12 | + | |
| 13 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
| 17 | + | |
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
21 |
| - | |
| 21 | + | |
22 | 22 |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
| 7 | + | |
7 | 8 |
| |
8 | 9 |
| |
9 | 10 |
| |
| |||
18 | 19 |
| |
19 | 20 |
| |
20 | 21 |
| |
21 |
| - | |
| 22 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
| 7 | + | |
7 | 8 |
| |
8 | 9 |
| |
9 | 10 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
| 7 | + | |
7 | 8 |
| |
8 | 9 |
| |
9 | 10 |
| |
10 | 11 |
| |
11 | 12 |
| |
12 | 13 |
| |
13 | 14 |
| |
14 |
| - | |
| 15 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
| 7 | + | |
7 | 8 |
| |
8 | 9 |
| |
9 | 10 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
| 7 | + | |
7 | 8 |
| |
8 | 9 |
| |
9 | 10 |
| |
| |||
16 | 17 |
| |
17 | 18 |
| |
18 | 19 |
| |
19 |
| - | |
| 20 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
22 |
| - | |
| 22 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
| 7 | + | |
7 | 8 |
| |
8 | 9 |
| |
9 | 10 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
| 7 | + | |
7 | 8 |
| |
8 | 9 |
| |
9 | 10 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
3 | 2 |
| |
4 | 3 |
| |
5 | 4 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
3 | 2 |
| |
4 | 3 |
| |
5 | 4 |
| |
| |||
27 | 26 |
| |
28 | 27 |
| |
29 | 28 |
| |
30 |
| - | |
| 29 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
3 | 2 |
| |
4 | 3 |
| |
5 | 4 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
3 | 2 |
| |
4 | 3 |
| |
5 | 4 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
3 | 2 |
| |
4 | 3 |
| |
5 | 4 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
| 8 | + | |
8 | 9 |
| |
9 | 10 |
| |
10 | 11 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
14 |
| - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 |
| |
16 | 20 |
| |
17 | 21 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
| 8 | + | |
8 | 9 |
| |
9 | 10 |
| |
| 11 | + | |
10 | 12 |
| |
11 | 13 |
| |
12 | 14 |
| |
| |||
20 | 22 |
| |
21 | 23 |
| |
22 | 24 |
| |
23 |
| - | |
| 25 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
| 8 | + | |
8 | 9 |
| |
9 | 10 |
| |
10 | 11 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
| 8 | + | |
8 | 9 |
| |
9 |
| - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 |
| |
11 | 14 |
| |
12 | 15 |
| |
13 | 16 |
| |
14 |
| - | |
| 17 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
| 8 | + | |
8 | 9 |
| |
9 | 10 |
| |
10 | 11 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 |
| - | |
| 7 | + | |
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
13 |
| - | |
14 |
| - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
19 |
| - | |
| 19 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 |
| - | |
| 8 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
3 | 5 |
| |
4 |
| - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
5 | 14 |
| |
6 | 15 |
| |
7 | 16 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
20 |
| - | |
| 20 | + | |
21 | 21 |
| |
22 | 22 |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
3 | 2 |
| |
4 | 3 |
| |
5 | 4 |
| |
6 | 5 |
| |
7 | 6 |
| |
8 | 7 |
| |
| 8 | + | |
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 |
| - | |
| 15 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 |
| - | |
9 | 8 |
| |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 |
| - | |
| 40 | + | |
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
44 |
| - | |
| 44 | + | |
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
48 |
| - | |
| 48 | + | |
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
| |||
61 | 61 |
| |
62 | 62 |
| |
63 | 63 |
| |
64 |
| - | |
| 64 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
24 |
| - | |
| 24 | + | |
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
29 |
| - | |
| 29 | + | |
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
37 |
| - | |
| 37 | + | |
38 | 38 |
| |
39 | 39 |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 |
| - | |
| 7 | + | |
8 | 8 |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
| 8 | + | |
8 | 9 |
| |
9 | 10 |
| |
10 | 11 |
| |
|
0 commit comments