File tree
1,064 files changed
+41305
-29994
lines changed- images
- lcci
- 01.02.Check Permutation
- 01.04.Palindrome Permutation
- 01.08.Zero Matrix
- 03.02.Min Stack
- 03.03.Stack of Plates
- 08.10.Color Fill
- 16.02.Words Frequency
- 16.14.Best Line
- 17.09.Get Kth Magic Number
- 17.19.Missing Two
- 17.20.Continuous Median
- lcof2/剑指 Offer II 052. 展平二叉搜索树
- lcof
- 面试题03. 数组中重复的数字
- 面试题04. 二维数组中的查找
- 面试题05. 替换空格
- 面试题06. 从尾到头打印链表
- 面试题07. 重建二叉树
- 面试题09. 用两个栈实现队列
- 面试题10- I. 斐波那契数列
- 面试题10- II. 青蛙跳台阶问题
- 面试题11. 旋转数组的最小数字
- 面试题12. 矩阵中的路径
- 面试题13. 机器人的运动范围
- 面试题14- I. 剪绳子
- 面试题14- II. 剪绳子 II
- 面试题15. 二进制中1的个数
- 面试题16. 数值的整数次方
- 面试题17. 打印从1到最大的n位数
- 面试题18. 删除链表的节点
- 面试题19. 正则表达式匹配
- 面试题20. 表示数值的字符串
- 面试题21. 调整数组顺序使奇数位于偶数前面
- 面试题22. 链表中倒数第k个节点
- 面试题24. 反转链表
- 面试题25. 合并两个排序的链表
- 面试题26. 树的子结构
- 面试题27. 二叉树的镜像
- 面试题28. 对称的二叉树
- 面试题29. 顺时针打印矩阵
- 面试题30. 包含min函数的栈
- 面试题32 - I. 从上到下打印二叉树
- 面试题32 - II. 从上到下打印二叉树 II
- 面试题32 - III. 从上到下打印二叉树 III
- 面试题33. 二叉搜索树的后序遍历序列
- 面试题34. 二叉树中和为某一值的路径
- 面试题35. 复杂链表的复制
- 面试题36. 二叉搜索树与双向链表
- 面试题37. 序列化二叉树
- 面试题38. 字符串的排列
- 面试题39. 数组中出现次数超过一半的数字
- 面试题40. 最小的k个数
- 面试题41. 数据流中的中位数
- 面试题42. 连续子数组的最大和
- 面试题43. 1~n整数中1出现的次数
- 面试题44. 数字序列中某一位的数字
- 面试题45. 把数组排成最小的数
- 面试题46. 把数字翻译成字符串
- 面试题47. 礼物的最大价值
- 面试题48. 最长不含重复字符的子字符串
- 面试题49. 丑数
- 面试题50. 第一个只出现一次的字符
- 面试题51. 数组中的逆序对
- 面试题52. 两个链表的第一个公共节点
- 面试题53 - I. 在排序数组中查找数字 I
- 面试题53 - II. 0~n-1中缺失的数字
- 面试题54. 二叉搜索树的第k大节点
- 面试题55 - I. 二叉树的深度
- 面试题55 - II. 平衡二叉树
- 面试题56 - I. 数组中数字出现的次数
- 面试题56 - II. 数组中数字出现的次数 II
- 面试题57 - II. 和为s的连续正数序列
- 面试题57. 和为s的两个数字
- 面试题58 - I. 翻转单词顺序
- 面试题58 - II. 左旋转字符串
- 面试题59 - I. 滑动窗口的最大值
- 面试题59 - II. 队列的最大值
- 面试题60. n个骰子的点数
- 面试题61. 扑克牌中的顺子
- 面试题62. 圆圈中最后剩下的数字
- 面试题63. 股票的最大利润
- 面试题65. 不用加减乘除做加法
- 面试题66. 构建乘积数组
- 面试题68 - I. 二叉搜索树的最近公共祖先
- 面试题68 - II. 二叉树的最近公共祖先
- solution
- 0000-0099
- 0006.Zigzag Conversion
- 0010.Regular Expression Matching
- 0016.3Sum Closest
- 0031.Next Permutation
- 0043.Multiply Strings
- 0050.Pow(x, n)
- 0060.Permutation Sequence
- 0065.Valid Number
- 0099.Recover Binary Search Tree
- 0100-0199
- 0102.Binary Tree Level Order Traversal
- 0104.Maximum Depth of Binary Tree
- 0109.Convert Sorted List to Binary Search Tree
- 0111.Minimum Depth of Binary Tree
- 0117.Populating Next Right Pointers in Each Node II
- 0129.Sum Root to Leaf Numbers
- 0138.Copy List with Random Pointer
- 0155.Min Stack
- 0157.Read N Characters Given Read4
- 0158.Read N Characters Given read4 II - Call Multiple Times
- 0170.Two Sum III - Data structure design
- 0189.Rotate Array
- 0200-0299
- 0206.Reverse Linked List
- 0217.Contains Duplicate
- 0227.Basic Calculator II
- 0232.Implement Queue using Stacks
- 0242.Valid Anagram
- 0244.Shortest Word Distance II
- 0264.Ugly Number II
- 0283.Move Zeroes
- 0295.Find Median from Data Stream
- 0300-0399
- 0301.Remove Invalid Parentheses
- 0303.Range Sum Query - Immutable
- 0341.Flatten Nested List Iterator
- 0343.Integer Break
- 0381.Insert Delete GetRandom O(1) - Duplicates allowed
- 0389.Find the Difference
- 0392.Is Subsequence
- 0400-0499
- 0404.Sum of Left Leaves
- 0415.Add Strings
- 0493.Reverse Pairs
- 0500-0599
- 0546.Remove Boxes
- 0566.Reshape the Matrix
- 0589.N-ary Tree Preorder Traversal
- 0600-0699
- 0604.Design Compressed String Iterator
- 0635.Design Log Storage System
- 0653.Two Sum IV - Input is a BST
- 0669.Trim a Binary Search Tree
- 0700-0799
- 0705.Design HashSet
- 0707.Design Linked List
- 0709.To Lower Case
- 0733.Flood Fill
- 0762.Prime Number of Set Bits in Binary Representation
- 0769.Max Chunks To Make Sorted
- 0771.Jewels and Stones
- 0776.Split BST
- 0791.Custom Sort String
- 0792.Number of Matching Subsequences
- 0794.Valid Tic-Tac-Toe State
- 0795.Number of Subarrays with Bounded Maximum
- 0800-0899
- 0805.Split Array With Same Average
- 0808.Soup Servings
- 0809.Expressive Words
- 0827.Making A Large Island
- 0850.Rectangle Area II
- 0854.K-Similar Strings
- 0855.Exam Room
- 0858.Mirror Reflection
- 0864.Shortest Path to Get All Keys
- 0876.Middle of the Linked List
- 0878.Nth Magical Number
- 0884.Uncommon Words from Two Sentences
- 0890.Find and Replace Pattern
- 0895.Maximum Frequency Stack
- 0900-0999
- 0901.Online Stock Span
- 0912.Sort an Array
- 0913.Cat and Mouse
- 0927.Three Equal Parts
- 0940.Distinct Subsequences II
- 0953.Verifying an Alien Dictionary
- 0976.Largest Perimeter Triangle
- 1000-1099
- 1026.Maximum Difference Between Node and Ancestor
- 1038.Binary Search Tree to Greater Sum Tree
- 1047.Remove All Adjacent Duplicates In String
- 1057.Campus Bikes
- 1058.Minimize Rounding Error to Meet Target
- 1093.Statistics from a Large Sample
- 1096.Brace Expansion II
- 1100-1199
- 1106.Parsing A Boolean Expression
- 1129.Shortest Path with Alternating Colors
- 1145.Binary Tree Coloring Game
- 1146.Snapshot Array
- 1152.Analyze User Website Visit Pattern
- 1154.Day of the Year
- 1176.Diet Plan Performance
- 1200-1299
- 1207.Unique Number of Occurrences
- 1209.Remove All Adjacent Duplicates in String II
- 1210.Minimum Moves to Reach Target with Rotations
- 1244.Design A Leaderboard
- 1247.Minimum Swaps to Make Strings Equal
- 1249.Minimum Remove to Make Valid Parentheses
- 1250.Check If It Is a Good Array
- 1266.Minimum Time Visiting All Points
- 1271.Hexspeak
- 1279.Traffic Light Controlled Intersection
- 1290.Convert Binary Number in a Linked List to Integer
- 1300-1399
- 1309.Decrypt String from Alphabet to Integer Mapping
- 1313.Decompress Run-Length Encoded List
- 1348.Tweet Counts Per Frequency
- 1352.Product of the Last K Numbers
- 1356.Sort Integers by The Number of 1 Bits
- 1357.Apply Discount Every n Orders
- 1400-1499
- 1401.Circle and Rectangle Overlapping
- 1429.First Unique Number
- 1431.Kids With the Greatest Number of Candies
- 1436.Destination City
- 1441.Build an Array With Stack Operations
- 1443.Minimum Time to Collect All Apples in a Tree
- 1453.Maximum Number of Darts Inside of a Circular Dartboard
- 1469.Find All The Lonely Nodes
- 1491.Average Salary Excluding the Minimum and Maximum Salary
- 1494.Parallel Courses II
- 1500-1599
- 1502.Can Make Arithmetic Progression From Sequence
- 1512.Number of Good Pairs
- 1561.Maximum Number of Coins You Can Get
- 1572.Matrix Diagonal Sum
- 1588.Sum of All Odd Length Subarrays
- 1598.Crawler Log Folder
- 1600-1699
- 1600.Throne Inheritance
- 1603.Design Parking System
- 1604.Alert Using Same Key-Card Three or More Times in a One Hour Period
- 1616.Split Two Strings to Make Palindrome
- 1624.Largest Substring Between Two Equal Characters
- 1632.Rank Transform of a Matrix
- 1634.Add Two Polynomials Represented as Linked Lists
- 1658.Minimum Operations to Reduce X to Zero
- 1662.Check If Two String Arrays are Equivalent
- 1666.Change the Root of a Binary Tree
- 1668.Maximum Repeating Substring
- 1670.Design Front Middle Back Queue
- 1672.Richest Customer Wealth
- 1674.Minimum Moves to Make Array Complementary
- 1678.Goal Parser Interpretation
- 1682.Longest Palindromic Subsequence II
- 1684.Count the Number of Consistent Strings
- 1687.Delivering Boxes from Storage to Ports
- 1689.Partitioning Into Minimum Number Of Deci-Binary Numbers
- 1691.Maximum Height by Stacking Cuboids
- 1700-1799
- 1700.Number of Students Unable to Eat Lunch
- 1703.Minimum Adjacent Swaps for K Consecutive Ones
- 1704.Determine if String Halves Are Alike
- 1712.Ways to Split Array Into Three Subarrays
- 1730.Shortest Path to Get Food
- 1732.Find the Highest Altitude
- 1750.Minimum Length of String After Deleting Similar Ends
- 1752.Check if Array Is Sorted and Rotated
- 1754.Largest Merge Of Two Strings
- 1758.Minimum Changes To Make Alternating Binary String
- 1759.Count Number of Homogenous Substrings
- 1760.Minimum Limit of Balls in a Bag
- 1763.Longest Nice Substring
- 1765.Map of Highest Peak
- 1768.Merge Strings Alternately
- 1769.Minimum Number of Operations to Move All Balls to Each Box
- 1773.Count Items Matching a Rule
- 1779.Find Nearest Point That Has the Same X or Y Coordinate
- 1785.Minimum Elements to Add to Form a Given Sum
- 1790.Check if One String Swap Can Make Strings Equal
- 1792.Maximum Average Pass Ratio
- 1796.Second Largest Digit in a String
- 1797.Design Authentication Manager
- 1799.Maximize Score After N Operations
- 1800-1899
- 1800.Maximum Ascending Subarray Sum
- 1803.Count Pairs With XOR in a Range
- 1804.Implement Trie II (Prefix Tree)
- 1806.Minimum Number of Operations to Reinitialize a Permutation
- 1808.Maximize Number of Nice Divisors
- 1812.Determine Color of a Chessboard Square
- 1822.Sign of the Product of an Array
- 1825.Finding MK Average
- 1827.Minimum Operations to Make the Array Increasing
- 1828.Queries on Number of Points Inside a Circle
- 1830.Minimum Number of Operations to Make String Sorted
- 1832.Check if the Sentence Is Pangram
- 1834.Single-Threaded CPU
- 1839.Longest Substring Of All Vowels in Order
- 1844.Replace All Digits with Characters
- 1865.Finding Pairs With a Certain Sum
- 1880.Check if Word Equals Summation of Two Words
- 1900-1999
- 1920.Build Array from Permutation
- 1929.Concatenation of Array
- 1944.Number of Visible People in a Queue
- 1980.Find Unique Binary String
- 2000-2099
- 2000.Reverse Prefix of Word
- 2008.Maximum Earnings From Taxi
- 2011.Final Value of Variable After Performing Operations
- 2027.Minimum Moves to Convert String
- 2032.Two Out of Three
- 2037.Minimum Number of Moves to Seat Everyone
- 2042.Check if Numbers Are Ascending in a Sentence
- 2079.Watering Plants
- 2100-2199
- 2103.Rings and Rods
- 2108.Find First Palindromic String in the Array
- 2114.Maximum Number of Words Found in Sentences
- 2120.Execution of All Suffix Instructions Staying in a Grid
- 2125.Number of Laser Beams in a Bank
- 2160.Minimum Sum of Four Digit Number After Splitting Digits
- 2176.Count Equal and Divisible Pairs in an Array
- 2181.Merge Nodes in Between Zeros
- 2185.Counting Words With a Given Prefix
- 2200-2299
- 2236.Root Equals Sum of Children
- 2241.Design an ATM Machine
- 2245.Maximum Trailing Zeros in a Cornered Path
- 2283.Check if Number Has Equal Digit Count and Digit Value
- 2284.Sender With Largest Word Count
- 2286.Booking Concert Tickets in Groups
- 2287.Rearrange Characters to Make Target String
- 2293.Min Max Game
- 2296.Design a Text Editor
- 2299.Strong Password Checker II
- 2300-2399
- 2301.Match Substring After Replacement
- 2309.Greatest English Letter in Upper and Lower Case
- 2315.Count Asterisks
- 2319.Check if Matrix Is X-Matrix
- 2325.Decode the Message
- 2331.Evaluate Boolean Binary Tree
- 2341.Maximum Number of Pairs in Array
- 2351.First Letter to Appear Twice
- 2363.Merge Similar Items
- 2400-2499
- 2403.Minimum Time to Kill All Monsters
- 2407.Longest Increasing Subsequence II
- 2408.Design SQL
- 2409.Count Days Spent Together
- 2414.Length of the Longest Alphabetical Continuous Substring
- 2416.Sum of Prefix Scores of Strings
- 2417.Closest Fair Integer
- 2421.Number of Good Paths
- 2424.Longest Uploaded Prefix
- 2426.Number of Pairs Satisfying Inequality
- 2431.Maximize Total Tastiness of Purchased Fruits
- 2432.The Employee That Worked on the Longest Task
- 2433.Find The Original Array of Prefix Xor
- 2434.Using a Robot to Print the Lexicographically Smallest String
- 2435.Paths in Matrix Whose Sum Is Divisible by K
- 2439.Minimize Maximum of Array
- 2444.Count Subarrays With Fixed Bounds
- 2447.Number of Subarrays With GCD Equal to K
- 2448.Minimum Cost to Make Array Equal
- 2455.Average Value of Even Numbers That Are Divisible by Three
- 2459.Sort Array by Moving Items to Empty Space
- 2460.Apply Operations to an Array
- 2462.Total Cost to Hire K Workers
- 2465.Number of Distinct Averages
- 2467.Most Profitable Path in a Tree
- 2469.Convert the Temperature
- 2470.Number of Subarrays With LCM Equal to K
- 2471.Minimum Number of Operations to Sort a Binary Tree by Level
- 2476.Closest Nodes Queries in a Binary Search Tree
- 2479.Maximum XOR of Two Non-Overlapping Subtrees
- 2482.Difference Between Ones and Zeros in Row and Column
- 2488.Count Subarrays With Median K
- 2493.Divide Nodes Into the Maximum Number of Groups
- 2496.Maximum Value of a String in an Array
- 2500-2599
- 2502.Design Memory Allocator
- 2512.Reward Top K Students
- 2514.Count Anagrams
- 2515.Shortest Distance to Target String in a Circular Array
- 2519.Count the Number of K-Big Indices
- 2520.Count the Digits That Divide a Number
- 2521.Distinct Prime Factors of Product of Array
- 2522.Partition String Into Substrings With Values at Most K
- 2526.Find Consecutive Integers from a Data Stream
- 2529.Maximum Count of Positive Integer and Negative Integer
- 2532.Time to Cross a Bridge
- 2535.Difference Between Element Sum and Digit Sum of an Array
- 2539.Count the Number of Good Subsequences
- 2540.Minimum Common Value
- 2541.Minimum Operations to Make Array Equal II
- 2542.Maximum Subsequence Score
- 2543.Check if Point Is Reachable
- 2546.Apply Bitwise Operations to Make Strings Equal
- 2548.Maximum Price to Fill a Bag
- 2550.Count Collisions of Monkeys on a Polygon
- images
- 2553.Separate the Digits in an Array
- 2554.Maximum Number of Integers to Choose From a Range I
- 2555.Maximize Win From Two Segments
- 2556.Disconnect Path in a Binary Matrix by at Most One Flip
- images
- 2557.Maximum Number of Integers to Choose From a Range II
- 2558.Take Gifts From the Richest Pile
- 2559.Count Vowel Strings in Ranges
- 2560.House Robber IV
- 2561.Rearranging Fruits
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
1,064 files changed
+41305
-29994
lines changedLines changed: 18149 additions & 17830 deletions
Loading
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
7 |
| - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
8 | 9 |
| |
9 | 10 |
| |
10 | 11 |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
| 3 | + | |
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
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 |
| |
23 |
| - | |
| 23 | + | |
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 |
| - | |
| 8 | + | |
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 |
| - | |
| 18 | + | |
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
22 |
| - | |
| 22 | + | |
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 |
| - | |
| 16 | + | |
| 17 | + | |
17 | 18 |
| |
18 | 19 |
| |
19 | 20 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
71 | 71 |
| |
72 | 72 |
| |
73 | 73 |
| |
74 |
| - | |
| 74 | + | |
75 | 75 |
| |
76 | 76 |
| |
77 | 77 |
| |
| |||
94 | 94 |
| |
95 | 95 |
| |
96 | 96 |
| |
97 |
| - | |
| 97 | + | |
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 |
| - | |
| 8 | + | |
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
|
0 commit comments