Skip to content

fengvyi/LeetCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 

Repository files navigation

LeetCode solution language

My C++ solutions of LeetCode Online Judge questions. So far, 447 out of 581 algorithms questions have been included, the indices are not continuous because I solve questions in order of descending frequency. I'll keep updating for new questions and better solutions. Also, feel free to visit my LeetCode discuss home page for latest posts and discussions.

Table

# Title Solution Difficulty Tag Discuss
1 Two Sum C++ Easy Array / Hash Table discuss
2 Add Two Numbers C++ Medium Linked List discuss
3 Longest Substring Without Repeating Characters C++ Medium Hash Table / Two Pointers discuss
4 Median of Two Sorted Arrays C++ Hard Array / Binary Search discuss
5 Longest Palindromic Substring C++ Medium String discuss
6 ZigZag Conversion C++ Medium String discuss
7 Reverse Integer C++ Easy Math discuss
8 String to Integer (atoi) C++ Medium String discuss
9 Palindrome Number C++ Easy Math discuss
10 Regular Expression Matching C++ Hard String / Dynamic Programming / Backtracking discuss
11 Container With Most Water C++ Medium Array / Two Pointers discuss
12 Integer to Roman C++ Medium String discuss
13 Roman to Integer C++ Easy String discuss
14 Longest Common Prefix C++ Easy String discuss
15 3Sum C++ Medium Array / Two Pointers discuss
16 3Sum Closest C++ Medium Array / Two Pointers discuss
17 Letter Combinations of a Phone Number C++ Medium Backtracking / String discuss
18 4Sum C++ Medium Array discuss
19 Remove Nth Node From End of List C++ Medium Linked List / Two Pointers discuss
20 Valid Parentheses C++ Easy Stack discuss
21 Merge Two Sorted Lists C++ Easy Linked List discuss
22 Generate Parentheses C++ Medium String / Backtracking discuss
23 Merge k Sorted Lists C++ Hard Linked List / Heap discuss
24 Swap Nodes in Pairs C++ Medium Linked List discuss
25 Reverse Nodes in k-Group C++ Hard Linked List discuss
26 Remove Duplicates from Sorted Array C++ Easy Array / Two Pointers discuss
27 Remove Element C++ Easy Array / Two Pointers discuss
28 Implement strStr() C++ Easy String discuss
31 Next Permutation C++ Medium Array dsicuss
33 Search in Rotated Sorted Array C++ Medium Array / Binary Search discuss
34 Search for a Range C++ Medium Array / Binary Search discuss
35 Search Insert Position C++ Easy Array / Binary Search discuss
36 Valid Sudoku C++ Medium Hash Table discuss
38 Count and Say C++ Easy String discuss
39 Combination Sum C++ Medium Array / Backtracking discuss
40 Combination Sum II C++ Medium Array / Backtracking discuss
41 First Missing Positive C++ Hard Array discuss
42 Trapping Rain Water C++ Hard Array / Two Pointers / Stack discuss
43 Multiply Strings C++ Medium String discuss
44 Wildcard Matching C++ Hard String / Backtracking / Greedy discuss
45 Jump Game II C++ Hard Array / Greedy discuss
46 Permutations C++ Medium Backtracking discuss
47 Permutations II C++ Medium Backtracking discuss
48 Rotate Image C++ Medium Matrix discuss
49 Group Anagrams C++ Medium Hash Table / String discuss
50 Pow(x, n) C++ Medium Binary Search discuss
53 Maximum Subarray C++ Easy Dynamic Programming / Array discuss
54 Spiral Matrix C++ Medium Array discuss
55 Jump Game C++ Medium Array / Greedy discuss
56 Merge Intervals C++ Medium Array / Sort discuss
57 Insert Interval C++ Hard Array / Sort discuss
58 Length of Last Word C++ Easy String discuss
59 Spiral Matrix II C++ Medium Array discuss
60 Permutation Sequence C++ Medium Backtracking / Math discuss
61 Rotate List C++ Medium Linked List / Two Pointers discuss
62 Unique Paths C++ Medium Array / Dynamic Programming discuss
63 Unique Paths II C++ Medium Array / Dynamic Programming discuss
64 Minimum Path Sum C++ Medium Array / Dynamic Programming discuss
66 Plus One C++ Easy Array / Math discuss
67 Add Binary C++ Easy String discuss
68 Text Justification C++ Hard String discuss
69 Sqrt(x) C++ Easy Binary Search / Math discuss
70 Climbing Stairs C++ Easy Dynamic Programming discuss
71 Simplify Path C++ Medium Stack / String discuss
73 Set Matrix Zeroes C++ Medium Array discuss
74 Search a 2D Matrix C++ Medium Array / Binary Search discuss
75 Sort Colors C++ Medium Array / Two Pointers discuss
76 Minimum Window Substring C++ Hard Hash Table / Two pointers / String discuss
78 Subsets C++ Medium Array / Backtracking discuss
79 Word Search C++ Medium Matrix / Backtracking discuss
80 Remove Duplicates from Sorted Array II C++ Medium Array / Two Pointers discuss
82 Remove Duplicates from Sorted List II C++ Medium Linked List discuss
83 Remove Duplicates from Sorted List C++ Easy Linked List discuss
85 Maximal Rectangle C++ Hard Array discuss
86 Partition List C++ Medium Linked List discuss
88 Merge Sorted Array C++ Easy Array / Two Pointers discuss
90 Subsets II C++ Medium Array / Backtracking discuss
91 Decode Ways C++ Medium Dynamic Programming / String discuss
92 Reverse Linked List II C++ Medium Linked List discuss
94 Binary Tree Inorder Traversal C++ Medium Tree / Stack discuss
95 Unique Binary Search Trees II C++ Medium Tree discuss
98 Validate Binary Search Tree C++ Medium Tree discuss
99 Recover Binary Search Tree C++ Hard Tree / DFS discuss
100 Same Tree C++ Easy Tree / DFS discuss
101 Symmetric Tree C++ Easy Tree discuss
102 Binary Tree Level Order Traversal C++ Medium Tree / DFS / BFS discuss
103 Binary Tree Zigzag Level Order Traversal C++ Medium Tree / BFS discuss
104 Maximum Depth of Binary Tree C++ Easy Tree discuss
105 Construct Binary Tree from Preorder and Inorder Traversal C++ Medium Array / Tree / DFS discuss
107 Binary Tree Level Order Traversal II C++ Easy Tree discuss
108 Convert Sorted Array to Binary Search Tree C++ Easy Tree / DFS discuss
109 Convert Sorted List to Binary Search Tree C++ Medium Linked List / DFS discuss
110 Balanced Binary Tree C++ Easy Tree / DFS discuss
111 Minimum Depth of Binary Tree C++ Easy Tree discuss
112 Path Sum C++ Easy Tree / DFS discuss
113 Path Sum II C++ Medium Tree / DFS discuss
114 Flatten Binary Tree to Linked List C++ Medium Tree / DFS discuss
116 Populating Next Right Pointers in Each Node C++ Medium Tree / BFS discuss
117 Populating Next Right Pointers in Each Node II C++ Medium Tree / Level-order Traversal discuss
118 Pascal's Triangle C++ Easy Array discuss
119 Pascal's Triangle II C++ Easy Array discuss
120 Triangle C++ Medium Array / Dynamic Programming discuss
121 Best Time to Buy and Sell Stock C++ Easy Array / Dynamic Programming discuss
124 Binary Tree Maximum Path Sum C++ Hard Tree / DFS discuss
125 Valid Palindrome C++ Easy String / Two Pointers discuss
127 Word Ladder C++ Medium String / BFS discuss
128 Longest Consecutive Sequence C++ Hard Array / Unoin Find discuss
129 Sum Root to Leaf Numbers C++ Medium Tree / DFS / BFS discuss
130 Surrounded Regions C++ Medium DFS / BFS / Union Find discuss
131 Palindrome Partitioning C++ Medium Backtracking discuss
133 Clone Graph C++ Medium Graph / DFS / BFS discuss
134 Gas Station C++ Medium Greedy discuss
136 Single Number C++ Easy Bit Manipulation discuss
138 Copy List with Random Pointer C++ Medium Hash Table / Linked List discuss
139 Word Break C++ Medium Dynamic Programming discuss
141 Linked List Cycle C++ Easy Linked List / Two Pointers discuss
142 Linked List Cycle II C++ Medium Linked List / Two Pointers discuss
143 Reorder List C++ Medium Linked List discuss
144 Binary Tree Preorder Traversal C++ Medium Tree / Stack discuss
145 Binary Tree Postorder Traversal C++ Hard Tree / Stack discuss
146 LRU Cache C++ Hard Design discuss
151 Reverse Words in a String C++ Medium String discuss
155 Min Stack C++ Easy Stack / Design discuss
157 Read N Characters Given Read4 C++ Easy String discuss
158 Read N Characters Given Read4 II - Call multiple times C++ Hard String discuss
159 Longest Substring with At Most Two Distinct Characters C++ Hard String / Two Pointers discuss
161 One Edit Distance C++ Medium String discuss
162 Find Peak Element C++ Medium Binary Search discuss
163 Missing Ranges C++ Medium Array discuss
168 Excel Sheet Column Title C++ Easy Math discuss
169 Majority Element C++ Easy Array discuss
171 Excel Sheet Column Number C++ Easy Math discuss
173 Binary Search Tree Iterator C++ Medium Tree / Stack / Design discuss
186 Reverse Words in a String II C++ Medium String discuss
191 Number of 1 Bits C++ Easy Bit Manipulation discuss
198 House Robber C++ Easy Dynamic Programming discuss
200 Number of Islands C++ Medium BFS / Union Find discuss
205 Isomorphic Strings C++ Easy Hash Table discuss
206 Reverse Linked List C++ Easy Linked List discuss
207 Course Schedule C++ Medium Graph / BFS / Topological Sort discuss
208 Implement Trie (Prefix Tree) C++ Medium Trie / Design discuss
209 Minimum Size Subarray Sum C++ Medium Array / Two Pointers discuss
210 Course Schedule II C++ Medium Graph / BFS / Topological Sort discuss
211 Add and Search Word - Data structure design C++ Medium Design / Trie discuss
212 Word Search II C++ Hard Backtracking / Trie discuss
214 Shortest Palindrome C++ Hard String discuss
215 Kth Largest Element in an Array C++ Medium Sort / Partition discuss
221 Maximal Square C++ Medium Dynamic Programming / BFS discuss
223 Rectangle Area C++ Medium Math discuss
224 Basic Calculator C++ Hard String / Stack discuss
226 Invert Binary Tree C++ Easy Tree discuss
227 Basic Calculator II C++ Medium String discuss
228 Summary Ranges C++ Medium Array discuss
229 Majority Element II C++ Medium Array discuss
230 Kth Smallest Element in a BST C++ Medium Tree discuss
231 Power of Two C++ Easy Bit Manipulation discuss
234 Palindrome Linked List C++ Easy Linked List / Two Pointers discuss
235 Lowest Common Ancestor of a Binary Search Tree C++ Easy Tree discuss
236 Lowest Common Ancestor of a Binary Tree C++ Medium Tree discuss
238 Product of Array Except Self C++ Medium Array discuss
239 Sliding Window Maximum C++ Hard Heap discuss
240 Search a 2D Matrix II C++ Medium Binary Search / Divide and Conquer discuss
244 Shortest Word Distance II C++ Medium Hash Table / Design discuss
246 Strobogrammatic Number C++ Easy Hash Table / Math discuss
247 Strobogrammatic Number II C++ Medium Math / Recursion discuss
249 Group Shifted Strings C++ Medium String discuss
251 Flatten 2D Vector C++ Medium Design discuss
252 Meeting Rooms C++ Easy Sort discuss
253 Meeting Rooms II C++ Medium Heap / Sort discuss
255 Verify Preorder Sequence in Binary Search Tree C++ Medium Stack / Tree discuss
257 Binary Tree Paths C++ Easy Tree / DFS / BFS discuss
258 Add Digits C++ Easy Math discuss
259 3Sum Smaller C++ Medium Array / Two Pointers discuss
261 Graph Valid Tree C++ Medium Graph / BFS / DFS / Union Find discuss
263 Ugly Number C++ Easy Math discuss
264 Ugly Number II C++ Medium Dynamic Programming / Math discuss
266 Palindrome Permutation C++ Easy Hash Table discuss
267 Palindrome Permutation II C++ Medium Backtracking discuss
268 Missing Number C++ Easy Array / Bit Manipulation discuss
269 Alien Dictionary C++ Hard Graph / Topological Sort discuss
270 Closest Binary Search Tree Value C++ Easy Tree / Binary Search discuss
271 Encode and Decode Strings C++ Medium String / Design discuss
272 Closest Binary Search Tree Value II C++ Hard Tree / Stack discuss
273 Integer to English Words C++ Hard String discuss
274 H-Index C++ Medium Sort discuss
275 H-Index II C++ Medium Binary Search discuss
276 Paint Fence C++ Easy Dynamic Programming discuss
277 Find the Celebrity C++ Medium Array discuss
278 First Bad Version C++ Easy Binary Search discuss
279 Perfect Squares C++ Medium Math / Dynamic Programming discuss
280 Wiggle Sort C++ Easy Array discuss
281 Zigzag Iterator C++ Medium Design discuss
282 Expression Add Operators C++ Hard Divide and Conquer discuss
283 Move Zeroes C++ Easy Array / Two Pointers discuss
284 Peeking Iterator C++ Medum Design discuss
285 Inorder Successor in BST C++ Medium Tree discuss
286 Walls and Gates C++ Medium BFS discuss
289 Game of Life C++ Medium Array discuss
290 Word Pattern C++ Easy Hash Table discuss
293 Flip Game C++ Easy String discuss
294 Flip Game II C++ Medium Backtracking discuss
295 Find Median from Data Stream C++ Hard Heap / Design discuss
297 Serialize and Deserialize Binary Tree C++ Hard Tree / Design discuss
298 Binary Tree Longest Consecutive Sequence C++ Medium Tree discuss
300 Longest Increasing Subsequence C++ Medium Binary Search / Dynamic Programming discuss
301 Remove Invalid Parentheses C++ Hard Backtracking / DFS / BFS discuss
303 Range Sum Query - Immutable C++ Easy Dynamic Programming discuss
304 Range Sum Query 2D - Immutable C++ Medium Dynamic Programming discuss
305 Number of Islands II C++ Hard Union Find discuss
307 Range Sum Query - Mutable C++ Medium Segment Tree discuss
309 Best Time to Buy and Sell Stock with Cooldown C++ Medium Dynamic Programming discuss
310 Minimum Height Trees C++ Medium BFS/ Graph discuss
311 Sparse Matrix Multiplication C++ Medium Matrix discuss
313 Super Ugly Number C++ Medium Dynamic Programming / Math discuss
314 Binary Tree Vertical Order Traversal C++ Medium BFS discuss
315 Count of Smaller Numbers After Self C++ Hard Divide and Conqur / Binary Search Tree discuss
317 Shortest Distance from All Buildings C++ Hard BFS discuss
318 Maximum Product of Word Lengths C++ Medium Bit Manipulation discuss
323 Number of Connected Components in an Undirected Graph C++ Medium Graph / Union Find / BFS / DFS discuss
325 Maximum Size Subarray Sum Equals k C++ Medium Array / Hash Table discuss
329 Longest Increasing Path in a Matrix C++ Hard DFS / Memorization discuss
331 Verify Preorder Serialization of a Binary Tree C++ Medium Stack discuss
332 Reconstruct Itinerary C++ Medium Graph / DFS discuss
333 Largest BST Subtree C++ Medium Tree discuss
334 Increasing Triplet Subsequence C++ Medium Array discuss
336 Palindrome Pairs C++ Hard Hash Table / String / Trie discuss
339 Nested List Weight Sum C++ Easy DFS discuss
340 Longest Substring with At Most K Distinct Characters C++ Hard Hash Table / String discuss
341 Flatten Nested List Iterator C++ Medium Stack / Design discuss
344 Reverse String C++ Easy String discuss
347 Top K Frequent Elements C++ Medium Hash Table / Heap discuss
348 Design Tic-Tac-Toe C++ Medium Design discuss
351 Android Unlock Patterns C++ Medium DFS / Dynamic Programming discuss
354 Russian Doll Envelopes C++ Hard Binary Search / Dynamic Programming discuss
355 Design Twitter C++ Medium Hash Table / Design discuss
359 Logger Rate Limiter C++ Easy Hash Table / Design
360 Sort Transformed Array C++ Medium Math / Two Pointers discuss
361 Bomb Enemy C++ Medium Dynamic Programming discuss
362 Design Hit Counter C++ Medium Design discuss
364 Nested List Weight Sum II C++ Medium DFS discuss
369 Plus One Linked List C++ Medium Linked List discuss
373 Find K Pairs with Smallest Sums C++ Medium Heap discuss
377 Combination Sum IV C++ Medium Dynamic Programming discuss
378 Kth Smallest Element in a Sorted Matrix C++ Medium Binary Search / Heap discuss
380 Insert Delete GetRandom O(1) C++ Medium Hash Table / Design discuss
382 Linked List Random Node C++ Medium Reservoir Sampling discuss
394 Decode String C++ Medium String / DFS discuss
398 Random Pick Index C++ Medium Reservoir Sampling discuss
399 Evaluate Division C++ Medium Graph discuss
402 Remove K Digits C++ Medium Greedy discuss
404 Sum of Left Leaves C++ Easy Tree discuss
408 Valid Word Abbreviation C++ Easy String discuss
409 Longest Palindrome C++ Easy Hash Table discuss
411 Minimum Unique Word Abbreviation C++ Hard Backtracking discuss
412 Fizz Buzz C++ Easy Array discuss
416 Partition Equal Subset Sum C++ Medium Dynamic Programming discuss
417 Pacific Atlantic Water Flow C++ Medium DFS / BFS discuss
418 Sentence Screen Fitting C++ Medium Dynamic Programming
433 Minimum Genetic Mutation C++ Medium BFS discuss
435 Non-overlapping Intervals C++ Medium Greedy discuss
436 Find Right Interval C++ Medium Array / Binary Search discuss
438 Find All Anagrams in a String C++ Easy Hash Table discuss
441 Arranging Coins C++ Easy Math discuss
444 Sequence Reconstruction C++ Medium Graph / Topological Sort discuss
450 Delete Node in a BST C++ Medium Tree discuss
451 Sort Characters By Frequency C++ Medium Hash Table / Heap discuss
461 Hamming Distance C++ Easy Bit Manipulation discuss
467 Unique Substrings in Wraparound String C++ Medium Dynamic Programming discuss
473 Matchsticks to Square C++ Medium DFS discuss
477 Total Hamming Distance C++ Medium Bit Manipulation discuss
482 License Key Formatting C++ Medium Array discuss
484 Find Permutation C++ Medium Greedy discuss
486 Predict the Winner C++ Medium Dynamic Programming / Minimax discuss
487 Max Consecutive Ones II C++ Medium Two Pointers discuss
489 Robot Room Cleaner C++ Hard DFS discuss
490 The Maze C++ Medium BFS / DFS
494 Target Sum C++ Medium Backtracking discuss
496 Next Greater Element I C++ Easy Stack discuss
498 Diagonal Traverse C++ Medium Matrix discuss
499 The Maze III C++ Hard DFS / BFS
503 Next Greater Element II C++ Medium Stack discuss
505 The Maze II C++ Medium DFS / BFS discuss
508 Most Frequent Subtree Sum C++ Medium Tree / Hash Table discuss
513 Find Bottom Left Tree Value C++ Medium Tree / BFS / DFS discuss
515 Find Largest Value in Each Tree Row C++ Medium Tree / BFS / DFS discuss
523 Continuous Subarray Sum C++ Medium Dynamic Programming discuss
524 Longest Word in Dictionary through Deleting C++ Medium Two Pointers discuss
525 Contiguous Array C++ Medium Hash Table discuss
531 Lonely Pixel I C++ Medium Array / DFS discuss
535 Encode and Decode TinyURL C++ Medium String discuss
536 Construct Binary Tree from String C++ Medium String / Tree discuss
538 Convert BST to Greater Tree C++ Easy DFS discuss
540 Single Element in a Sorted Array C++ Medium Array / Binary Search discuss
541 Reverse String II C++ Easy String discuss
542 01 Matrix C++ Medium BFS / DFS discuss
543 Diameter of Binary Tree C++ Easy Tree discuss
547 Friend Circles C++ Medium DFS / Union Find discuss
549 Binary Tree Longest Consecutive Sequence II C++ Medium Tree discuss
554 Brick Wall C++ Medium Hash Table discuss
556 Next Greater Element III C++ Medium String
560 Subarray Sum Equals K C++ Medium Array / Map discuss
562 Longest Line of Consecutive One in Matrix C++ Medium Array discuss
565 Array Nesting C++ Medium Array discuss
566 Reshape the Matrix C++ Easy Array discuss
567 Permutation in String C++ Medium Two Pointers discuss
572 Subtree of Another Tree C++ Easy Tree discuss
582 Kill Process C++ Medium Tree / BFS / DFS discuss
583 Delete Operation for Two Strings C++ Medium Dynamic Programming discuss
599 Minimum Index Sum of Two Lists C++ Easy Hash Table discuss
606 Construct String from Binary Tree C++ Easy Tree / String discuss
611 Valid Triangle Number C++ Medium Array discuss
616 Add Bold Tag in String C++ Medium String disucss
621 Task Scheduler C++ Medium Array / Queue discuss
632 Smallest Range C++ Hard Two Pointers discuss
633 Sum of Square Numbers C++ Easy Math discuss
635 Design Log Storage System C++ Medium String / Design discuss
636 Exclusive Time of Functions C++ Medium Stack discuss
637 Average of Levels in Binary Tree C++ Easy BFS discuss
639 Decode Ways II C++ Hard Dynamic Programming discuss
642 Design Search Autocomplete System C++ Hard Design / Trie discuss
643 Maximum Average Subarray I C++ Easy Array discuss
645 Set Mismatch C++ Easy Hash Table / Math discuss
647 Palindromic Substrings C++ Medium String discuss
648 Replace Words C++ Medium Hash Table / Trie discuss
652 Find Duplicate Subtrees C++ Medium Tree discuss
653 Two Sum IV - Input is a BST C++ Easy DFS discuss
654 Maximum Binary Tree C++ Medium Tree discuss
657 Judge Route Circle C++ Easy String discuss
658 Find K Closest Elements C++ Medium Binary Search discuss
659 Split Array into Consecutive Subsequences C++ Medium Greedy discuss
662 Maximum Width of Binary Tree C++ Medium Tree / BFS / DFS discuss
663 Equal Tree Partition C++ Medium Tree discuss
665 Non-decreasing Array C++ Easy Array discuss
669 Trim a Binary Search Tree C++ Easy Tree discuss
670 Maximum Swap C++ Medium Array / Math discuss
671 Second Minimum Node In a Binary Tree C++ Easy Tree discuss
673 Number of Longest Increasing Subsequence C++ Medium Dynamic Programming discuss
674 Longest Continuous Increasing Subsequence C++ Easy Array discuss
676 Implement Magic Dictionary C++ Medium Hash Table / Trie discuss
677 Map Sum Pairs C++ Medium Trie discuss
679 24 Game C++ Hard DFS discuss
680 Valid Palindrome II C++ Easy String discuss
681 Next Closest Time C++ Medium String discuss
683 K Empty Slots C++ Hard Array / Binary Search discuss
684 Redundant Connection C++ Medium Graph / Union Find discuss
685 Redundant Connection II C++ Hard Graph / DFS / Union Find discuss
686 Repeated String Match C++ Easy String discuss
687 Longest Univalue Path C++ Easy Tree / DFS discuss
688 Knight Probability in Chessboard C++ Medium Dynamic Programming discuss
689 Maximum Sum of 3 Non-Overlapping Subarrays C++ Hard Array / Dynamic Programming discuss
690 Employee Importance C++ Easy Hash Table / BFS / DFS discuss
692 Top K Frequent Words C++ Medium Hash Table / Heap discuss
693 Binary Number with Alternating Bits C++ Easy Bit Manipulation discuss
694 Number of Distinct Islands C++ Medium Hash Table / DFS discuss
695 Max Area of Island C++ Easy Array / DFS discuss
696 Count Binary Substrings C++ Easy String discuss
697 Degree of an Array C++ Easy Array discuss
701 Insert into a Binary Search Tree C++ Medium Array
713 Subarray Product Less Than K C++ Medium Array discuss
717 1-bit and 2-bit Characters C++ Easy Array discuss
718 Maximum Length of Repeated Subarray C++ Medium Array / Dynamic Programming discuss
720 Longest Word in Dictionary C++ Easy Hash Table / Trie discuss
723 Candy Crush C++ Medium Array / Two Pointers discuss
724 Find Pivot Index C++ Easy Array discuss
725 Split Linked List in Parts C++ Medium Linked List discuss
728 Self Dividing Numbers C++ Easy Math discuss
729 My Calendar I C++ Medium Array discuss
733 Flood Fill C++ Easy DFS discuss
734 Sentence Similarity C++ Easy Hash Table discuss
735 Asteroid Collision C++ Medium Stack discuss
739 Daily Temperatures C++ Medium Stack / Hash Table discuss
740 Delete and Earn C++ Medium Dynamic Programming discuss
742 Closest Leaf in a Binary Tree C++ Medium Tree / Graph discuss
746 Min Cost Climbing Stairs C++ Easy Array / Dynamic Programming discuss
747 Largest Number At Least Twice of Others C++ Easy Array discuss
750 Number Of Corner Rectangles C++ Medium Dynamic Programming
753 Cracking the Safe C++ Hard DFS
758 Bold Words in String C++ Easy String discuss
760 Find Anagram Mappings C++ Easy Hash Table discuss
763 Partition Labels C++ Medium Two Pointers / Greedy disucss
765 Couples Holding Hands C++ Hard Greedy / Union Find / Greedy disucss
766 Toeplitz Matrix C++ Easy Array discuss
769 Max Chunks To Make Sorted C++ Medium Array discuss
771 Jewels and Stones C++ Easy Hash Table discuss
773 Sliding Puzzle C++ Hard BFS
777 Swap Adjacent in LR String C++ Medium Brainteaser discuss
779 K-th Symbol in Grammar C++ Medium Recursion discuss
783 Minimum Distance Between BST Nodes C++ Easy Tree discuss
784 Letter Case Permutation C++ Easy String discuss
785 Is Graph Bipartite C++ Medium Graph discuss
787 Cheapest Flights Within K Stops C++ Medium Graph / Heap discuss
791 Custom Sort String C++ Medium String discuss
792 Number of Matching Subsequences C++ Medium Array discuss
797 All Paths From Source to Target C++ Medium DFS / Graph discuss
798 Smallest Rotation with Highest Score C++ Hard Array discuss
799 Champagne Tower C++ Medium Array discuss
802 Find Eventual Safe States C++ Medium DFS / Graph discuss
803 Bricks Falling When Hit C++ Hard Union Find discuss
804 Unique Morse Code Words C++ Easy String discuss
805 Split Array With Same Average C++ Hard Math
806 Number of Lines To Write String C++ Easy String discuss
807 Max Increase to Keep City Skyline C++ Medium Array discuss
809 Expressive Words C++ Medium String discuss
814 Binary Tree Pruning C++ Medium Tree discuss
815 Bus Routes C++ Hard BFS discuss
819 Most Common Word C++ Easy String discuss
820 Short Encoding of Words C++ Medium Trie discuss
821 Shortest Distance to a Character C++ Easy String discuss
826 Most Profit Assigning Work C++ Medium Two Pointers / Binary Search discuss
830 Positions of Large Groups C++ Easy Array discuss
832 Flipping an Image C++ Easy Array discuss
834 Sum of Distances in Tree C++ Hard Tree / DFS discuss
836 Rectangle Overlap C++ Easy Math discuss
841 Keys and Rooms C++ Medium DFS / BFS / Graph discuss
843 Guess the Word C++ Hard Minimax
844 Backspace String Compare C++ Easy Stack / Two Pointers discuss
845 Longest Mountain in Array C++ Medium Two Pointers discuss
846 Hand of Straights C++ Medium Map discuss
848 Shifting Letters C++ Medium String disucss
849 Maximize Distance to Closest Person C++ Easy Array discuss
852 Peak Index in a Mountain Array C++ Easy Binary Search disucss
853 Car Fleet C++ Medium Stack
855 Exam Room C++ Medium Map discuss
857 Minimum Cost to Hire K Workers C++ Hard Heap
859 Buddy Strings C++ Easy String discuss
872 Leaf-Similar Trees C++ Easy Tree / DFS discuss
876 Middle of the Linked List C++ Easy Linked List disucss
884 Uncommon Words from Two Sentences C++ Easy Hash Table discuss
888 Fair Candy Swap C++ Easy Array discuss
889 Construct Binary Tree from Preorder and Postorder Traversal C++ Medium Tree
890 Find and Replace Pattern C++ Medium String discuss
894 All Possible Full Binary Trees C++ Medium Tree / Recursion
896 Monotonic Array C++ Easy Array discuss
900 RLE Iterator C++ Medium Array
904 Fruit Into Baskets C++ Medium Two Pointers
911 Online Election C++ Medium Binary Search / Map
914 X of a Kind in a Deck of Cards C++ Easy Array / Math
916 Word Subsets C++ Medium String
925 Long Pressed Name C++ Easy String discuss
929 Unique Email Addresses C++ Easy String
932 Beautiful Array C++ Medium Divide and Conquer
933 Number of Recent Calls C++ Easy Queue
935 Knight Dialer C++ Medium Dynamic Programming discuss
938 Range Sum of BST C++ Medium Tree discuss
939 Minimum Area Rectangle C++ Medium Hash Table discuss
941 Valid Mountain Array C++ Easy Array
946 Validate Stack Sequences C++ Medium Stack
951 Flip Equivalent Binary Trees C++ Medium Tree discuss

About

My C++ solutions for LeetCode questions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages