| English | 简体中文 |


My LeetCode Solutions

Last updated: 2021-02-25 09:00:02

1631Path With Minimum EffortGo49.3%mediumDepth-first Search, Union Find, Graph, Binary Search
1584Min Cost to Connect All PointsGo67.0%mediumUnion Find
1579Remove Max Number of Edges to Keep Graph Fully TraversableGo62.0%hardUnion Find
1489Find Critical and Pseudo-Critical Edges in Minimum Spanning TreeGo70.0%hardDepth-first Search, Union Find
1423Maximum Points You Can Obtain from CardsGo55.8%mediumArray, Dynamic Programming, Sliding Window
1319Number of Operations to Make Network ConnectedGo62.1%mediumDepth-first Search, Breadth-first Search, Union Find
1232Check If It Is a Straight LineGo47.1%easyGeometry, Array, Math
1208Get Equal Substrings Within BudgetGo49.7%mediumArray, Sliding Window
1203Sort Items by Groups Respecting DependenciesGo63.9%hardDepth-first Search, Graph, Topological Sort
1202Smallest String With Swaps❤️Go49.9%mediumUnion Find, Array
1128Number of Equivalent Domino PairsGo54.5%easyArray
1046Last Stone WeightGo65.9%easyHeap, Greedy
1018Binary Prefix Divisible By 5Go51.8%easyArray
1004Max Consecutive Ones IIIGo61.0%mediumTwo Pointers, Sliding Window
995Minimum Number of K Consecutive Bit FlipsGo54.2%hardGreedy, Sliding Window
992Subarrays with K Different IntegersGo44.7%hardHash Table, Two Pointers, Sliding Window
989Add to Array-Form of IntegerGo48.2%easyArray
978Longest Turbulent SubarrayGo47.2%mediumArray, Dynamic Programming, Sliding Window
509Fibonacci NumberGo68.3%easyArray
959Regions Cut By SlashesGo74.7%mediumDepth-first Search, Union Find, Graph
947Most Stones Removed with Same Row or ColumnGo61.3%mediumDepth-first Search, Union Find
888Fair Candy SwapGo63.8%easyArray
887Super Egg DropGo29.0%hardMath, Binary Search, Dynamic Programming
861Score After Flipping MatrixGo81.0%mediumGreedy
860Lemonade ChangeGo58.3%easyGreedy
842Split Array into Fibonacci SequenceGo49.3%mediumGreedy, String, Backtracking
839Similar String GroupsGo57.3%hardDepth-first Search, Union Find, Graph
830Positions of Large GroupsGo54.4%easyArray
803Bricks Falling When HitGo49.0%hardUnion Find
787Cheapest Flights Within K StopsGo36.8%mediumHeap, Breadth-first Search, Dynamic Programming
778Swim in Rising WaterGo60.6%hardHeap, Depth-first Search, Union Find, Binary Search
703Kth Largest Element in a StreamGo50.6%easyHeap, Design
766Toeplitz MatrixGo70.9%easyArray
765Couples Holding HandsGo66.8%hardGreedy, Union Find, Graph
763Partition LabelsGo76.6%mediumGreedy, Two Pointers
746Min Cost Climbing StairsGo54.8%easyArray, Dynamic Programming
744Find Smallest Letter Greater Than TargetGo45.7%easyBinary Search
739Daily Temperatures❤️Go66.1%mediumStack, Hash Table
738Monotone Increasing DigitsGo50.3%mediumGreedy
724Find Pivot IndexGo43.2%easyArray
721Accounts MergeGo46.8%mediumDepth-first Search, Union Find
714Best Time to Buy and Sell Stock with Transaction FeeGo69.9%mediumGreedy, Array, Dynamic Programming
695Max Area of IslandGo64.8%mediumDepth-first Search, Array
687Longest Univalue PathGo42.6%mediumTree, Recursion
685Redundant Connection IIGo44.3%hardTree, Depth-first Search, Union Find, Graph
684Redundant ConnectionGo66.3%mediumTree, Union Find, Graph
674Longest Continuous Increasing SubsequenceGo47.3%easyArray
671Second Minimum Node In a Binary TreeGo46.4%easyTree
669Trim a Binary Search TreeGo67.1%mediumTree, Recursion
665Non-decreasing ArrayGo26.5%easyArray
649Dota2 SenateGo48.2%mediumGreedy
647Palindromic SubstringsGo65.0%mediumString, Dynamic Programming
643Maximum Average Subarray I❤️Go45.6%easyArray
637Average of Levels in Binary TreeGo68.8%easyTree
633Sum of Square NumbersGo35.1%mediumMath
628Maximum Product of Three NumbersGo52.2%easyArray, Math
621Task SchedulerGo55.7%mediumGreedy, Queue, Array
617Merge Two Binary TreesGo78.8%easyTree
605Can Place FlowersGo34.1%easyGreedy, Array
581Shortest Unsorted Continuous SubarrayGo35.9%mediumArray
572Subtree of Another TreeGo47.3%easyTree
567Permutation in StringGo41.8%mediumTwo Pointers, Sliding Window
566Reshape the MatrixGo70.7%easyArray
561Array Partition IGo76.7%easyArray
560Subarray Sum Equals K❤️Go44.9%mediumArray, Hash Table
547Number of ProvincesGo61.4%mediumDepth-first Search, Union Find
543Diameter of Binary Tree❤️Go52.2%easyTree
540Single Element in a Sorted ArrayGo59.2%mediumBinary Search
538Convert BST to Greater TreeGo65.8%mediumTree, Depth-first Search, Binary Search Tree, Recursion
524Longest Word in Dictionary through DeletingGo47.2%mediumSort, Two Pointers
513Find Bottom Left Tree ValueGo72.5%mediumTree, Depth-first Search, Breadth-first Search
501Find Mode in Binary Search TreeGo50.0%easyTree
494Target SumGo44.8%mediumDepth-first Search, Dynamic Programming
485Max Consecutive OnesGo60.1%easyArray
480Sliding Window MedianGo45.0%hardSliding Window
461Hamming DistanceGo78.8%easyBit Manipulation
460LFU CacheGo43.5%hardDesign
455Assign CookiesGo57.8%easyGreedy
452Minimum Number of Arrows to Burst BalloonsGo50.9%mediumGreedy, Sort
451Sort Characters By FrequencyGo66.6%mediumHeap, Hash Table
448Find All Numbers Disappeared in an ArrayGo63.7%easyArray
441Arranging CoinsGo42.0%easyMath, Binary Search
438Find All Anagrams in a String❤️Go49.4%mediumHash Table
437Path Sum III❤️Go56.6%mediumTree
435Non-overlapping IntervalsGo49.3%mediumGreedy
424Longest Repeating Character ReplacementGo52.7%mediumTwo Pointers, Sliding Window
416Partition Equal Subset Sum❤️Go49.4%mediumDynamic Programming
406Queue Reconstruction by HeightGo72.3%mediumGreedy
404Sum of Left LeavesGo56.6%easyTree
399Evaluate DivisionGo59.4%mediumUnion Find, Graph
395Longest Substring with At Least K Repeating Characters❤️Go46.0%mediumRecursion, Divide and Conquer, Sliding Window
394Decode String❤️Go54.1%mediumStack, Depth-first Search
392Is SubsequenceGo50.8%easyGreedy, Binary Search, Dynamic Programming
389Find the DifferenceGo69.5%easyBit Manipulation, Hash Table
387First Unique Character in a StringGo51.4%easyHash Table, String
376Wiggle SubsequenceGo45.2%mediumGreedy, Dynamic Programming
349Intersection of Two ArraysGo73.5%easySort, Hash Table, Two Pointers, Binary Search
347Top K Frequent ElementsGo62.0%mediumHeap, Hash Table
345Reverse Vowels of a StringGo51.5%easyTwo Pointers, String
344Reverse StringGo74.4%easyTwo Pointers, String
338Counting BitsGo76.7%mediumBit Manipulation, Dynamic Programming
337House Robber IIIGo61.2%mediumTree, Depth-first Search
330Patching ArrayGo53.7%hardGreedy
328Odd Even Linked ListGo65.7%mediumLinked List
326Power of ThreeGo48.1%easyMath
322Coin ChangeGo42.6%mediumDynamic Programming
316Remove Duplicate LettersGo47.7%mediumStack, Greedy, String
309Best Time to Buy and Sell Stock with CooldownGo57.5%mediumDynamic Programming
303Range Sum Query - ImmutableGo64.7%easyDynamic Programming
300Longest Increasing Subsequence❤️Go47.3%mediumBinary Search, Dynamic Programming
290Word PatternGo45.8%easyHash Table
287Find the Duplicate NumberGo66.3%mediumArray, Two Pointers, Binary Search
283Move ZeroesGo63.7%easyArray, Two Pointers
279Perfect SquaresGo59.3%mediumBreadth-first Search, Math, Dynamic Programming
278First Bad VersionJava42.2%easyBinary Search
268Missing NumberGo59.6%easyBit Manipulation, Array, Math
242Valid AnagramGo63.6%easySort, Hash Table
241Different Ways to Add ParenthesesGo73.3%mediumDivide and Conquer
240Search a 2D Matrix IIGo44.1%mediumBinary Search, Divide and Conquer
239Sliding Window MaximumGo49.6%hardHeap, Sliding Window
238Product of Array Except SelfGo71.4%mediumArray
237Delete Node in a Linked ListGo84.0%easyLinked List
236Lowest Common Ancestor of a Binary TreeGo66.4%mediumTree
234Palindrome Linked ListGo45.5%easyLinked List, Two Pointers
232Implement Queue using StacksGo66.0%easyStack, Design
230Kth Smallest Element in a BSTGo73.0%mediumTree, Binary Search
228Summary RangesGo58.6%easyArray
226Invert Binary TreeGo78.0%easyTree
225Implement Stack using QueuesGo66.7%easyStack, Design
221Maximal SquareGo44.4%mediumDynamic Programming
218The Skyline Problem❤️Go45.8%hardHeap, Binary Indexed Tree, Segment Tree, Divide and Conquer, Line Sweep
217Contains DuplicateGo55.1%easyArray, Hash Table
215Kth Largest Element in an ArrayGo64.8%mediumHeap, Divide and Conquer
212Word Search IIGo45.5%hardTrie, Backtracking
210Course Schedule IIGo52.8%mediumDepth-first Search, Breadth-first Search, Graph, Topological Sort
208Implement Trie (Prefix Tree)❤️Go69.9%mediumDesign, Trie
207Course ScheduleGo54.9%mediumDepth-first Search, Breadth-first Search, Graph, Topological Sort
206Reverse Linked ListGo71.4%easyLinked List
205Isomorphic StringsGo49.8%easyHash Table
204Count PrimesGo38.4%easyHash Table, Math
200Number of IslandsGo52.5%mediumDepth-first Search, Breadth-first Search, Union Find
198House Robber❤️Go47.6%mediumDynamic Programming
191Number of 1 BitsGo71.3%easyBit Manipulation
190Reverse BitsGo63.7%easyBit Manipulation
189Rotate ArrayGo45.7%mediumArray
188Best Time to Buy and Sell Stock IVGo36.4%hardDynamic Programming
172Factorial Trailing ZeroesGo42.0%easyMath
169Majority ElementGo65.7%easyBit Manipulation, Array, Divide and Conquer
167Two Sum II - Input array is sortedGo57.5%easyArray, Two Pointers, Binary Search
166Fraction to Recurring DecimalGo28.7%mediumHash Table, Math
160Intersection of Two Linked ListsGo57.6%easyLinked List
155Min StackGo56.3%easyStack, Design
153Find Minimum in Rotated Sorted ArrayGo52.4%mediumArray, Binary Search
152Maximum Product SubarrayGo41.1%mediumArray, Dynamic Programming
149Max Points on a Line❤️Go23.7%hardHash Table, Math
148Sort ListGo67.5%mediumSort, Linked List
146LRU Cache❤️Go51.8%mediumDesign
145Binary Tree Postorder TraversalGo74.2%mediumStack, Tree
144Binary Tree Preorder TraversalGo69.2%mediumStack, Tree
142Linked List Cycle IIGo54.4%mediumLinked List, Two Pointers
141Linked List CycleGo50.8%easyLinked List, Two Pointers
140Word Break IIGo44.4%hardDynamic Programming, Backtracking
139Word Break❤️Go49.2%mediumDynamic Programming
136Single NumberGo70.9%easyBit Manipulation, Hash Table
131Palindrome PartitioningGo70.4%mediumDepth-first Search, Dynamic Programming, Backtracking
130Surrounded RegionsGo42.3%mediumDepth-first Search, Breadth-first Search, Union Find
127Word LadderGo46.0%hardBreadth-first Search
125Valid PalindromeGo47.0%easyTwo Pointers, String
123Best Time to Buy and Sell Stock IIIGo51.1%hardArray, Dynamic Programming
122Best Time to Buy and Sell Stock IIGo66.6%easyGreedy, Array
121Best Time to Buy and Sell Stock❤️Go56.0%easyArray, Dynamic Programming
119Pascal’s Triangle IIGo65.0%easyArray
118Pascal’s TriangleGo70.0%easyArray
114Flatten Binary Tree to Linked ListGo71.8%mediumTree, Depth-first Search
112Path SumGo51.8%easyTree, Depth-first Search
111Minimum Depth of Binary TreeGo46.7%easyTree, Depth-first Search, Breadth-first Search
110Balanced Binary TreeGo55.3%easyTree, Depth-first Search, Recursion
105Construct Binary Tree from Preorder and Inorder TraversalGo69.2%mediumTree, Depth-first Search, Array
104Maximum Depth of Binary Tree❤️Go75.8%easyTree, Depth-first Search, Recursion
103Binary Tree Zigzag Level Order TraversalGo57.1%mediumStack, Tree, Breadth-first Search
102Binary Tree Level Order TraversalGo64.1%mediumTree, Breadth-first Search
101Symmetric Tree❤️Go53.6%easyTree, Depth-first Search, Breadth-first Search
98Validate Binary Search Tree❤️Go33.6%mediumTree, Depth-first Search, Recursion
96Unique Binary Search Trees❤️Go69.3%mediumTree, Dynamic Programming
95Unique Binary Search Trees IIGo67.3%mediumTree, Dynamic Programming
94Binary Tree Inorder TraversalGo74.9%mediumStack, Tree, Hash Table
88Merge Sorted ArrayGo49.4%easyArray, Two Pointers
86Partition ListGo62.4%mediumLinked List, Two Pointers
85Maximal RectangleGo51.7%hardStack, Array, Hash Table, Dynamic Programming
83Remove Duplicates from Sorted ListGo52.1%easyLinked List
79Word Search❤️Go44.1%mediumArray, Backtracking
78SubsetsGo79.5%mediumBit Manipulation, Array, Backtracking
75Sort Colors❤️Go57.6%mediumSort, Array, Two Pointers
70Climbing Stairs❤️Go51.5%easyDynamic Programming
69Sqrt(x)Go39.2%easyMath, Binary Search
64Minimum Path SumGo68.2%mediumArray, Dynamic Programming
62Unique PathsGo64.3%mediumArray, Dynamic Programming
56Merge IntervalsGo44.4%mediumSort, Array
55Jump Game❤️Go41.8%mediumGreedy, Array
53Maximum Subarray❤️Go53.4%easyArray, Divide and Conquer, Dynamic Programming
49Group AnagramsGo65.5%mediumHash Table, String
48Rotate ImageGo72.3%mediumArray
39Combination Sum❤️Go72.0%mediumArray, Backtracking
34Find First and Last Position of Element in Sorted ArrayGo42.3%mediumArray, Binary Search
33Search in Rotated Sorted ArrayGo40.6%mediumArray, Binary Search
31Next Permutation❤️Go36.5%mediumArray
22Generate ParenthesesGo76.9%mediumString, Backtracking
21Merge Two Sorted ListsGo65.4%easyRecursion, Linked List
20Valid Parentheses❤️Go43.7%easyStack, String
19Remove Nth Node From End of List❤️Go41.1%mediumLinked List, Two Pointers
17Letter Combinations of a Phone Number❤️Go56.0%mediumDepth-first Search, Recursion, String, Backtracking
153Sum❤️Go31.0%mediumArray, Two Pointers
11Container With Most Water❤️Go64.8%mediumArray, Two Pointers
5Longest Palindromic Substring❤️Go, Rust33.2%mediumString, Dynamic Programming
3Longest Substring Without Repeating CharactersGo, Rust36.5%mediumHash Table, Two Pointers, String, Sliding Window
2Add Two NumbersGo, Rust39.6%mediumRecursion, Linked List, Math
1Two SumGo, Rust50.3%easyArray, Hash Table