Skip to content
My LeetCode solutions with Chinese explanation.
Branch: master
Clone or download
Latest commit 496d55b Nov 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
solutions Create 307. Range Sum Query - Mutable.md Nov 18, 2019
.gitignore add .gitignore to ignore .DS_Store Jan 4, 2019
LICENSE add MIT LICENSE Sep 18, 2019
README.md add 307 Nov 18, 2019
_config.yml Set theme jekyll-theme-minimal Nov 16, 2019

README.md

LeetCode

My LeetCode solutions with Chinese explanation. 我的LeetCode中文题解。
每个题目都保证击败超过80%的提交,并尽量给出多种解法并分析算法复杂度。
每日持续更新中,欢迎交流,欢迎star :D

# 题目 题解 难度
1 Two Sum C++ Easy
2 Add Two Numbers C++ Medium
3 Longest Substring Without Repeating Characters C++ Medium
5 Longest Palindromic Substring C++ Medium
6 ZigZag Conversion C++ Medium
7 Reverse Integer C++ Easy
8 String to Integer (atoi) C++ Medium
9 Palindrome Number C++ Easy
11 Container With Most Water C++ Medium
12 Integer to Roman C++ Medium
13 Roman to Integer C++ Easy
14 Longest Common Prefix C++ Easy
15 3Sum C++ Medium
16 3Sum Closest C++ Medium
17 Letter Combinations of a Phone Number C++ Medium
18 4Sum C++ Medium
19 Remove Nth Node From End of List C++ Medium
20 Valid Parentheses C++ Easy
21 Merge Two Sorted Lists C++ Easy
22 Generate Parentheses C++ Medium
24 Swap Nodes in Pairs C++ Medium
26 Remove Duplicates from Sorted Array C++ Easy
27 Remove Element C++ Easy
29 Divide Two Integers C++ Medium
31 Next Permutation C++ Medium
34 Find First and Last Position of Element in Sorted C++ Medium
33 Search in Rotated Sorted Array C++ Medium
35 Search Insert Position C++ Easy
36 Valid Sudoku C++ Medium
38 Count and Say C++ Easy
39 Combination Sum C++ Medium
40 Combination Sum II C++ Medium
43 Multiply Strings C++ Medium
46 Permutations C++ Medium
47 Permutations II C++ Medium
48 Rotate Image C++ Medium
49 Group Anagrams C++ Medium
50 Pow(x, n) C++ Medium
53 Maximum Subarray C++ Easy
54 Spiral Matrix C++ Medium
55 Jump Game C++ Medium
56 Merge Intervals C++ Medium
58 Length of Last Word C++ Easy
59 Spiral Matrix II C++ Medium
60 Permutation Sequence C++ Medium
61 Rotate List C++ Medium
62 Unique Paths C++ Medium
63 Unique Paths II C++ Medium
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
73 Set Matrix Zeroes C++ Medium
74 Search a 2D Matrix C++ Medium
75 Sort Colors C++ Medium
77 Combinations C++ Medium
78 Subsets C++ Medium
79 Word Search C++ Medium
80 Remove Duplicates from Sorted Array II C++ Medium
81 Search in Rotated Sorted Array II C++ Medium
82 Remove Duplicates from Sorted List II C++ Medium
83 Remove Duplicates from Sorted List C++ Easy
86 Partition List C++ Medium
88 Merge Sorted Array C++ Easy
89 Gray Code C++ Medium
90 Subsets II C++ Medium
91 Decode Ways C++ Medium
92 Reverse Linked List II C++ Medium
93 Restore IP Addresses C++ Medium
94 Binary Tree Inorder Traversal C++ Medium
95 Unique Binary Search Trees II C++ Medium
96 Unique Binary Search Trees C++ Medium
98 Validate 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 C++ Easy
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 C++ Medium
114 Flatten Binary Tree to Linked List C++ Medium
116 Populating Next Right Pointers in Each Node C++ Medium
117 Populating Next Right Pointers in Each Node II C++ Medium
118 Pascal's Triangle C++ Easy
119 Pascal's Triangle 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 C++ Easy
123 Best Time to Buy and Sell Stock III C++ Hard
125 Valid Palindrome C++ Easy
127 Word Ladder C++ Medium
129 Sum Root to Leaf Numbers C++ Medium
130 Surrounded Regions C++ Medium
131 Palindrome Partitioning C++ Medium
133 Clone Graph C++ Medium
134 Gas Station C++ Medium
136 Single Number C++ Easy
137 Single Number II C++ Medium
138 Copy List with Random Pointer C++ Medium
139 Word Break C++ Medium
141 Linked List Cycle C++ Easy
142 Linked List Cycle II C++ Medium
143 Reorder List C++ Medium
144 Binary Tree Preorder Traversal C++ Medium
148 Sort List C++ Medium
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
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 C++ Easy
168 Excel Sheet Column Title C++ Easy
169 Majority Element C++ Easy
171 Excel Sheet Column Number C++ Easy
172 Factorial Trailing Zeroes C++ Easy
179 Largest Number C++ Medium
187 Repeated DNA Sequences C++ Medium
188 Best Time to Buy and Sell Stock IV C++ Hard
189 Rotate Array C++ Easy
190 Reverse Bits C++ Easy
191 Number of 1 Bits C++ Easy
198 House Robber C++ Easy
199 Binary Tree Right Side View C++ Medium
200 Number of Islands C++ Medium
201 Bitwise AND of Numbers Range C++ Medium
202 Happy Number C++ Easy
203 Remove Linked List Elements C++ Easy
204 Count Primes C++ Easy
205 Isomorphic Strings C++ Easy
206 Reverse Linked List C++ Easy
207 Course Schedule C++ Medium
209 Minimum Size Subarray Sum C++ Medium
210 Course Schedule II C++ Medium
215 Kth Largest Element in an Array C++ Medium
216 Combination Sum III C++ Medium
217 Contains Duplicate C++ Easy
219 Contains Duplicate II C++ Easy
220 Contains Duplicate III C++ Medium
221 Maximal Square C++ Medium
222 Count Complete Tree Nodes C++ Medium
223 Rectangle Area C++ Medium
225 Implement Stack using Queues C++ Easy
226 Invert Binary Tree C++ Easy
227 Basic Calculator II C++ Medium
228 Summary Ranges C++ Medium
229 Majority Element II C++ Medium
230 Kth Smallest Element in a BST C++ Medium
231 Power of Two C++ Easy
232 Implement Queue using Stacks C++ Easy
234 Palindrome Linked List C++ Easy
235 Lowest Common Ancestor of a Binary Search Tree C++ Easy
236 Lowest Common Ancestor of a Binary Tree C++ Medium
237 Delete Node in a Linked List C++ Easy
238 Product of Array Except Self C++ Medium
240 Search a 2D Matrix II C++ Medium
241 Different Ways to Add Parentheses C++ Medium
242 Valid Anagram C++ Easy
257 Binary Tree Paths C++ Easy
258 Add Digits C++ Easy
260 Single Number III C++ Medium
263 Ugly Number C++ Easy
264 Ugly Number II C++ Medium
268 Missing Number C++ Easy
274 H-Index C++ Medium
275 H-Index II C++ Medium
278 First Bad Version C++ Easy
279 Perfect Squares C++ Medium
283 Move Zeroes C++ Easy
287 Find the Duplicate Number C++ Medium
289 Game of Life C++ Medium
290 Word Pattern C++ Easy
292 Nim Game C++ Easy
300 Longest Increasing Subsequence C++ Medium
303 Range Sum Query - Immutable C++ Easy
304 Range Sum Query 2D - Immutable C++ Medium
306 Additive Number C++ Medium
307 Range Sum Query - Mutable C++ Medium
309 Best Time to Buy and Sell Stock with Cooldown C++ Medium
310 Minimum Height Trees C++ Medium
312 Burst Balloons C++ Hard
313 Super Ugly Number C++ Medium
318 Maximum Product of Word Lengths C++ Medium
319 Bulb Switcher C++ Medium
326 Power of Three C++ Easy
342 Power of Four C++ Easy
344 Reverse String C++ Easy
345 Reverse Vowels of a String C++ Easy
349 Intersection of Two Arrays C++ Easy
350 Intersection of Two Arrays II C++ Easy
367 Valid Perfect Square C++ Easy
371 Sum of Two Integers C++ Easy
374 Guess Number Higher or Lower C++ Easy
383 Ransom Note C++ Easy
387 First Unique Character in a String C++ Easy
389 Find the Difference C++ Easy
400 Nth Digit C++ Easy
404 Sum of Left Leaves C++ Easy
405 Convert a Number to Hexadecimal C++ Easy
409 Longest Palindrome C++ Easy
414 Third Maximum Number C++ Easy
415 Add Strings C++ Easy
429 N-ary Tree Level Order Traversal C++ Easy
434 Number of Segments in a String C++ Easy
437 Path Sum III C++ Easy
438 Find All Anagrams in a String C++ Easy
441 Arranging Coins C++ Easy
443 String Compression C++ Easy
447 Number of Boomerangs C++ Easy
448 Find All Numbers Disappeared in an Array C++ Easy
453 Minimum Moves to Equal Array Elements C++ Easy
455 Assign Cookies C++ Easy
459 Repeated Substring Pattern C++ Easy
461 Hamming Distance C++ Easy
463 Island Perimeter C++ Easy
475 Heaters C++ Easy
476 Number Complement C++ Easy
485 Max Consecutive Ones C++ Easy
496 Next Greater Element I C++ Easy
500 Keyboard Row C++ Easy
532 K-diff Pairs in an Array C++ Easy
561 Array Partition I C++ Easy
566 Reshape the Matrix C++ Easy
581 Shortest Unsorted Continuous Subarray C++ Easy
605 Can Place Flowers C++ Easy
628 Maximum Product of Three Numbers C++ Easy
643 Maximum Average Subarray I C++ Easy
661 Image Smoother C++ Easy
665 Non-decreasing Array C++ Easy
714 Best Time to Buy and Sell Stock with Transaction Fee C++ Medium
You can’t perform that action at this time.