Skip to content

✏️My Leetcode Solution Record written by C++

License

Notifications You must be signed in to change notification settings

XiaotaoGuo/Leetcode-Solution-In-Cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode-Solution-In-C++

time tracker Hex.pm

这是我的 LeetCode 刷题记录。刷题顺序大部分根据 Leetcode 分类顺序表 进行,目前所有题目用 C++ 求解并有对应博文记录解题思路。方法不一定最优,欢迎补充~

Category

# Problems Solution Code
Easy
1 Two Sum Solution code
26 Remove Duplicates from Sorted Array Solution code
66 Plus One Solution code
119 Pascal's Triangle II Solution code
121 Best Time to Buy and Sell Stock Solution code
122 Best Time to Buy and Sell Stock II Solution code
217 Contains Duplicate Solution code
412 Fizz Buzz Solution code
905 Sort Array By Parity Solution code
Medium
31 Next Permutation Solution code
48 Rotate Image Solution code
54 Spiral Matrix Solution code
55 Jump Game Solution code
59 Spiral Matrix II Solution code
73 Set Matrix Zeroes Solution code
79 Word Search Solution code
442 Find All Duplicates in an Array Solution code
987 Vertical Order Traversal of a Binary Tree Solution code
Hard
45 Jump Game II Solution code
123 Best Time to Buy and Sell Stock III Solution code
# Problems Solution Code
Easy
14 Longest Common Prefix Solution code
38 Count and Say Solution code
58 Length of Last Word Solution code
67 Add Binary Solution code
125 Valid Palindrome Solution code
383 Ransom Note Solution code
520 Detect Capital Solution code
824 Goat Latin Solution code
Medium
6 ZigZag Conversion Solution code
8 String to Integer (atoi) Solution code
43 Multiply Strings Solution code
151 Reverse Words in a String Solution code
165 Compare Version Numbers Solution code
Hard
68 Text Justification Solution code
952 Largest Component Size by Common Factor Solution code
# Problems Solution Code
Medium
179 Largest Number Solution code
# Problems Solution Code
Easy
7 Palindrome Number Solution code
9 Palindrome Number Solution code
13 Roman to Integer Solution code
168 Excel Sheet Column Title Solution code
171 Excel Sheet Column Number Solution code
258 Add Digits Solution code
1103 Distribute Candies to People Solution code
Medium
12 Integer to Roman Solution code
315 Bulb Switcher Solution code
Hard
60 Permutation Sequence Solution code
65 Valid Number Solution code
# Problems Solution Code
Easy
100 Same Tree Solution code
101 Symmetric Tree Solution code
104 Maximum Depth of Binary Tree Solution code
107 Binary Tree Level Order Traversal II Solution code
108 Convert Sorted Array to Binary Search Tree Solution code
110 Balanced Binary Tree Solution code
111 Minimum Depth of Binary Tree Solution code
112 Path Sum Solution code
226 Invert Binary Tree Solution code
235 Lowest Common Ancestor of a Binary Search Tree Solution code
257 Binary Tree Paths Solution code
404 Sum of Left Leaves Solution code
437 Path Sum III Solution code
Medium
94 Binary Tree Inorder Traversal Solution code
98 Validate Binary Search Tree Solution code
102 Binary Tree Level Order Traversal Solution code
103 Binary Tree Zigzag Level Order Traversal Solution code
105 Construct Binary Tree from Preorder and Inorder Traversal Solution code
106 Construct Binary Tree from Inorder and Postorder Traversal Solution code
113 Path Sum II Solution code
114 Flatten Binary Tree to Linked List Solution code
116 Populating Next Right Pointers in Each Node Solution code
125 Sum Root to Leaf Numbers Solution code
144 Binary Tree Preorder Traversal Solution code
145 Binary Tree Postorder Traversal Solution code
173 Binary Search Tree Iterator Solution code
199 Binary Tree Right Side View Solution code
230 Kth Smallest Element in a BST Solution code
236 Lowest Common Ancestor of a Binary Tree Solution code
337 House Robber III Solution code
450 Delete Node in a BST Solution code
669 Trim a Binary Search Tree Solution code
Hard
124 Binary Tree Maximum Path Sum Solution code
# Problems Solution Code
Medium
17 Letter Combinations of a Phone Number Solution code
39 Combination Sum Solution code
40 Combination Sum II Solution code
46 Permutations Solution code
47 Permutations II Solution code
77 Combinations Solution code
78 Subsets Solution code
89 Gray Code Solution code
90 Subsets II Solution code
93 Restore IP Addresses Solution code
216 Combination Sum III Solution code
1286 Iterator for Combination Solution code
Hard
37 Sudoku Solver Solution code
51 N-Queens Solution code
52 N-Queens Solution code
282 Expression Add Operators Solution code
140 Word Break II Solution code
# Problems Solution Code
Easy
70 Climbing Stairs Solution code
392 Is Subsequence Solution code
Medium
5 Longest Palindromic Substring Solution code
62 Unique Paths Solution code
63 Unique Paths II Solution code
64 Minimum Path Sum Solution code
120 Triangle Solution code
139 Word Break Solution code
279 Perfect Squares Solution code
322 Coin Change Solution code
375 Guess Number Higher or Lower II Solution code
377 Combination Sum IV Solution code
967 Numbers With Same Consecutive Differences Solution code
Hard
32 Longest Valid Parentheses Solution code
87 Scramble String Solution code
188 Best Time to Buy and Sell Stock IV Solution code
312 Burst Balloons Solution code
# Problems Solution Code
Easy
21 Merge Two Sorted Lists Solution code
83 Remove Duplicates from Sorted List Solution code
141 Linked List Cycle Solution code
160 Intersection of Two Linked Lists Solution code
203 Remove Linked List Elements Solution code
206 Reorder List Solution code
234 Palindrome Linked List Solution code
237 Delete Node in a Linked List Solution code
Medium
2 Add Two Numbers Solution code
19 Remove Nth Node From End of List Solution code
24 Swap Nodes in Pairs Solution code
61 Rotate List Solution code
82 Remove Duplicates from Sorted List II Solution code
86 Partition List Solution code
92 Reverse Linked List II Solution code
138 Copy List with Random Pointer Solution code
142 Linked List Cycle II Solution code
143 Reorder List Solution code
147 Insertion Sort List Solution code
148 Sort List Solution code
328 Odd Even Linked List Solution code
Hard
25 Merge k Sorted Lists Solution code
25 Reverse Nodes in k-Group Solution code
# Problems Solution Code
Easy
278 First Bad Version Solution code
349 Intersection of Two Arrays Solution code
374 Guess Number Higher or Lower Solution code
Medium
33 Search in Rotated Sorted Array Solution code
34 Find First and Last Position of Element in Sorted Array Solution code
74 Search a 2D Matrix Solution code
153 Find Minimum in Rotated Sorted Array Solution code
162 Find Peak Element Solution code
240 Search a 2D Matrix II Solution code
275 H-Index II Solution code
300 Longest Increasing Subsequence Solution code
378 Kth Smallest Element in a Sorted Matrix Solution code
436 Find Right Interval Solution code
497 Random Point in Non-overlapping Rectangles Solution code
Hard
154 Find Minimum in Rotated Sorted Array II Solution code
315 Count of Smaller Numbers After Self Solution code
354 Russian Doll Envelopes Solution code
# Problems Solution Code
Easy
342 Power of Four Solution code
389 Find the Difference Solution code
Medium
137 Single Number II Solution code
201 Bitwise AND of Numbers Range Solution code
260 Single Number III Solution code
318 Maximum Product of Word Lengths Solution code
371 Sum of Two Integers Solution code
393 UTF-8 Validation Solution code
# Problems Solution Code
Medium
211 Design Add and Search Words Data Structure Solution code
341 Flatten Nested List Iterator Solution code
380 Insert Delete GetRandom O(1) Solution code
Hard
381 Insert Delete GetRandom O(1) - Duplicates allowed Solution code
# Problems Solution Code
Medium
435 Non-overlapping Intervals Solution code
# Problems Solution Code
Easy
205 Isomorphic Strings Solution code
242 Valid Anagram Solution code
290 Word Pattern Solution code
387 First Unique Character in a String Solution code
409 Longest Palindrome Solution code
705 Design HashSet Solution code
Medium
994 Rotting Oranges Solution code
Hard
149 Max Points on a Line Solution code
# Problems Solution Code
Medium
969 Pancake Sorting Solution code
# Problems Solution Code
Easy
20 Valid Parentheses Solution code
155 Min Stack Solution code
225 Implement Stack using Queues Solution code
232 Implement Queue using Stacks Solution code
Medium
71 Simplify Path Solution code
150 Evaluate Reverse Polish Notation Solution code
227 Basic Calculator II Solution code
385 Mini Parser Solution code
388 Longest Absolute File Path Solution code
394 Decode String Solution code
983 Minimum Cost For Tickets Solution code
Hard
84 Largest Rectangle in Histogram Solution code
224 Basic Calculator Solution code
# Problems Solution Code
Easy
28 Implement strStr() Solution code
344 Reverse String Solution code
345 Reverse Vowels of a String Solution code
# Problems Solution Code
Medium
3 Longest Substring Without Repeating Characters Solution code
Hard
30 Substring with Concatenation of All Words Solution code
76 Minimum Window Substring Solution code
# Problems Solution Code
Hard
1032 Stream of Characters Solution code
# Problems Solution Code
Medium
130 Surrounded Regions Solution code
200 Number of Islands Solution code
Hard
329 Longest Increasing Path in a Matrix Solution code
# Problems Solution Code
Hard
126 Word Ladder II Solution code
127 Word Ladder Solution code
# Problems Solution Code
Medium
215 Kth Largest Element in an Array Solution code
313 Super Ugly Number Solution code
347 Top K Frequent Elements Solution code
373 Find K Pairs with Smallest Sums Solution code
# Problems Solution Code
Medium
133 Clone Graph Solution code
310 Minimum Height Trees Solution code
332 Reconstruct Itinerary Solution code
399 Evaluate Division Solution code
# Problems Solution Code
Medium
207 Course Schedule Solution code
210 Course Schedule II Solution code
# Problems Solution Code
Medium
382 Linked List Random Node Solution code
384 Shuffle an Array Solution code
398 Random Pick Index Solution code

About

✏️My Leetcode Solution Record written by C++

Topics

Resources

License

Stars

Watchers

Forks

Languages