Skip to content

Latest commit

History

960 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

LeetCode Problems' Solutions

Hits

If you like this project, please leave me a star ★ : )

English | 简体中文

This is my personal record of solving LeetCode Problems. The algorithms may not be optimal, I hope you can understand.

If you have any questions or advices, please discuss them in Issues.

Algorithm

#TitleSolutionDifficultyRelated Topics
1774Closest Dessert CostPython3MediumGreedy
1773Count Items Matching a RulePython3EasyArray, String
1758Minimum Changes To Make Alternating Binary StringPython3EasyGreedy, Array
1752Check if Array Is Sorted and RotatedPython3EasyArray
1748Sum of Unique ElementsPython3EasyArray, Hash Table
1742Maximum Number of Balls in a BoxPython3EasyArray
1736Latest Time by Replacing Hidden DigitsPython3EasyGreedy, String
1732Find the Highest AltitudePython3EasyArray
1725Number Of Rectangles That Can Form The Largest SquarePython3EasyGreedy
1720Decode XORed ArrayPython3EasyBit Manipulation
1716Calculate Money in Leetcode BankPython3EasyGreedy, Math
1710Maximum Units on a TruckPython3EasyGreedy, Sort
1704Determine if String Halves Are AlikePython3EasyString
1700Number of Students Unable to Eat LunchPython3EasyArray
1694Reformat Phone NumberPython3EasyString
1688Count of Matches in TournamentPython3EasyBacktracking
1684Count the Number of Consistent StringsPython3EasyString
1678Goal Parser InterpretationPython3EasyString
1672Richest Customer WealthPython3EasyArray
1668Maximum Repeating SubstringPython3EasyString
1662Check If Two String Arrays are EquivalentPython3EasyString
1656Design an Ordered StreamPython3EasyDesign, Array
1652Defuse the BombPython3EasyArray
1646Get Maximum in Generated ArrayPython3EasyArray
1640Check Array Formation Through ConcatenationPython3EasySort, Array, Hash Table
1636Sort Array by Increasing FrequencyPython3EasySort, Array
1629Slowest KeyPython3EasyArray
1624Largest Substring Between Two Equal CharactersPython3EasyString
1619Mean of Array After Removing Some ElementsPython3EasyArray
1614Maximum Nesting Depth of the ParenthesesPython3EasyString
1608Special Array With X Elements Greater Than or Equal XPython3EasyArray
1603Design Parking SystemPython3EasyDesign
1598Crawler Log FolderPython3EasyStack
1592Rearrange Spaces Between WordsPython3EasyString
1588Sum of All Odd Length SubarraysPython3EasyArray
1582Special Positions in a Binary MatrixPython3EasyArray
1576Replace All ?'s to Avoid Consecutive Repeating CharactersPython3EasyString
1572Matrix Diagonal SumPython3EasyArray
1566Detect Pattern of Length M Repeated K or More TimesPython3EasyArray
1560Most Visited Sector in a Circular TrackPython3EasyArray
1556Thousand SeparatorPython3EasyString
1550Three Consecutive OddsPython3EasyArray
1544Make The String GreatPython3EasyStack, String
1539Kth Missing Positive NumberPython3EasyArray, Hash Table
1534Count Good TripletsPython3EasyArray
1528Shuffle StringPython3EasySort
1523Count Odd Numbers in an Interval RangePython3EasyMath
1518Water BottlesPython3EasyGreedy
1512Number of Good PairsPython3EasyArray, Hash Table, Math
1507Reformat DatePython3EasyString
1502Can Make Arithmetic Progression From SequencePython3EasySort, Array
1496Path CrossingPython3EasyString
1491Average Salary Excluding the Minimum and Maximum SalaryPython3EasySort, Array
1486XOR Operation in an ArrayPython3EasyBit Manipulation, Array
1480Running Sum of 1d ArrayPython3EasyArray
1475Final Prices With a Special Discount in a ShopPython3EasyArray
1470Shuffle the ArrayPython3EasyArray
1464Maximum Product of Two Elements in an ArrayPython3EasyArray
1460Make Two Arrays Equal by Reversing Sub-arraysPython3EasyArray
1455Check If a Word Occurs As a Prefix of Any Word in a SentencePython3EasyString
1450Number of Students Doing Homework at a Given TimePython3EasyArray
1446Consecutive CharactersPython3EasyString
1441Build an Array With Stack OperationsPython3EasyStack
1436Destination CityPython3EasyString
1431Kids With the Greatest Number of CandiesPython3EasyArray
1422Maximum Score After Splitting a StringPython3EasyString
1417Reformat The StringPython3EasyString
1413Minimum Value to Get Positive Step by Step SumPython3EasyArray
1408String Matching in an ArrayPython3EasyString
1403Minimum Subsequence in Non-Increasing OrderPython3EasyGreedy, Sort
1399Count Largest GroupPython3EasyArray
1394Find Lucky Integer in an ArrayPython3EasyArray
1389Create Target Array in the Given OrderPython3EasyArray
1385Find the Distance Value Between Two ArraysPython3EasyArray
1380Lucky Numbers in a MatrixPython3EasyArray
1374Generate a String With Characters That Have Odd CountsPython3EasyString
1370Increasing Decreasing StringPython3EasySort, String
1365How Many Numbers Are Smaller Than the Current NumberPython3EasyArray, Hash Table
1360Number of Days Between Two DatesPython3EasyNone
1356Sort Integers by The Number of 1 BitsPython3EasySort, Bit Manipulation
1351Count Negative Numbers in a Sorted MatrixPython3EasyArray, Binary Search
1346Check If and Its Double ExistPython3EasyArray
1342Number of Steps to Reduce a Number to ZeroPython3EasyBit Manipulation
1337The K Weakest Rows in a MatrixPython3EasyArray, Binary Search
1332Remove Palindromic SubsequencesPython3EasyString
1331Rank Transform of an ArrayPython3EasyArray
1323Maximum 69 NumberPython3EasyMath
1317Convert Integer to the Sum of Two No-Zero IntegersPython3EasyMath
1313Decompress Run-Length Encoded ListPython3EasyArray
1309Decrypt String from Alphabet to Integer MappingPython3EasyString
1304Find N Unique Integers Sum up to ZeroPython3EasyArray
1299Replace Elements with Greatest Element on Right SidePython3EasyArray
1295Find Numbers with Even Number of DigitsPython3EasyArray
1290Convert Binary Number in a Linked List to IntegerPython3EasyBit Manipulation, Linked List
1287Element Appearing More Than 25% In Sorted ArrayPython3EasyArray
1281Subtract the Product and Sum of Digits of an IntegerPython3EasyMath
1275Find Winner on a Tic Tac Toe GamePython3EasyArray
1266Minimum Time Visiting All PointsPython3EasyGeometry, Array
1260Shift 2D GridPython3EasyArray
1252Cells with Odd Values in a MatrixPython3EasyArray
1237Find Positive Integer Solution for a Given EquationPython3EasyMath, Binary Search
1232Check If It a Straight LinePython3EasyGeometry, Array, Math
1221Split a String in Balanced StringsPython3EasyGreedy, String
1217Minimum Cost to Move Chips to The Same PositionPython3EasyGreedy, Array, Math
1207Unique Number of OccurrencesPython3EasyHash Table
1200Minimum Absolute DifferencePython3EasyArray
1189Maximum Number of BalloonsPython3EasyHash Table, String
1185Day of the WeekPython3EasyArray
1184Distance Between Bus StopsPython3EasyArray
1175Prime ArrangementsPython3EasyMath
1170Compare Strings by Frequency of the Smallest CharacterPython3EasyArray, String
1160Find Words That Can Be Formed by CharactersPython3EasyArray, Hash Table
1154Day of the YearPython3EasyMath
1137N-th Tribonacci NumberPython3EasyRecursion
1128Number of Equivalent Domino PairsPython3EasyArray
1122Relative Sort ArrayPython3EasySort, Array
1108Defanging an IP AddressPython3EasyString
1103Distribute Candies to PeoplePython3EasyMath
1089Duplicate ZerosPython3EasyArray
1078Occurrences After BigramPython3EasyHash Table
1071Greatest Common Divisor of StringsPython3EasyString
1051Height CheckerPython3EasyArray
1047Remove All Adjacent Duplicates In StringPython3EasyStack
1046Last Stone WeightPython3EasyHeap, Greedy
1037Valid BoomerangPython3EasyMath
1033Moving Stones Until ConsecutivePython3EasyBrainteaser
1030Matrix Cells in Distance OrderPython3EasySort
1025Divisor GamePython3EasyMath, Dynamic Programming
1022Sum of Root To Leaf Binary NumbersPython3EasyTree
1021Remove Outermost ParenthesesPython3EasyStack
1018Binary Prefix Divisible by 5Python3EasyArray
1013Partition Array Into Three Parts With Equal SumPython3EasyArray
1010Pairs of Songs With Total Durations Divisible by 60Python3EasyArray
1009Complement of Base 10 IntegerPython3EasyMath
1005Maximize Sum of Array After K NegationsPython3EasyGreedy
1002Find Common CharactersPython3EasyArray, Hash Table
999Available Captures for RookPython3EasyArray
997Find the Town JudgePython3EasyGraph
993Cousins in Binary TreePython3EasyTree, Breadth-first Search
989Add to Array-Form of IntegerPython3EasyArray
985Sum of Even Numbers After QueriesPython3EasyArray
977Squares of a Sorted ArrayPython3EasyArray, Two Pointers
976Largest Perimeter TrianglePython3EasySort, Math
970Powerful IntegersPython3EasyHash Table, Math
965Univalued Binary TreePython3EasyTree
961N-repeated Element in Size 2N ArrayPython3EasyHash Table
953Verifying an Alien DictionaryPython3EasyHash Table
944Delete Columns to Make SortedPython3EasyGreedy
942DI String MatchPython3EasyMath
941Valid Mountain ArrayPython3EasyArray
938Range Sum of BSTPython3EasyTree, Recursion
937Reorder Data in Log FilesPython3EasyString
933Number of Recent CallsPython3EasyQueue
929Unique Email AddressesPython3EasyString
925Long Pressed NamePython3EasyTwo Pointers, String
922Sort Array By Parity IIPython3EasySort, Array
917Reverse Only LettersPython3EasyString
914X of a Kind in a Deck of CardsPython3EasyArray, Math
908Smallest Range IPython3EasyMath
905Sort Array by ParityPython3EasyArray
897Increasing Order Search TreePython3EasyTree, Depth-first Search
896Monotonic ArrayPython3EasyArray
893Groups of Special-Equivalent StringsPython3EasyString
892Surface Area of 3D ShapesPython3EasyGeometry, Math
888Fair Candy SwapPython3EasyArray
884Uncommon Words from Two SentencesPython3EasyHash Table
883Projection Area of 3D shapesPython3EasyMath
876Middle of the Linked ListPython3EasyLinked List
874Walking Robot SimulationPython3EasyGreedy
872Leaf-Similar TreePython3EasyTree, Depth-first Search
868Binary GapPython3EasyMath
867Transpose MatrixPython3EasyArray
860Lemonade ChangePython3EasyGreedy
859Buddy StringsPython3EasyString
852Peak Index in a Mountain ArrayPython3EasyBinary Search
844Backspace String ComparePython3EasyStack, Two Pointers
836Rectangle OverlapPython3EasyMath
832Flipping an ImagePython3EasyArray
830Position of Large GroupsPython3EasyArray
824Goat LatinPython3EasyString
821Shortest Distance to a CharacterPython3EasyNone
819Most Common WordPython3EasyString
812Largest Triangle AreaPython3EasyMath
811Subdomain Visit CountPython3EasyHash Table
806Number of Lines To Write StringPython3EasyNone
804Unique Morse Code WordsPython3EasyString
796Rotate StringPython3EasyNone
788Rotated DigitsPython3EasyString
783Minimum Distance Between BST NodesPython3EasyTree, Recursion
771Jewels and StonesPython3EasyHash Table
766Toeplitz MatrixPython3EasyArray
762Prime Number of Set Bits in Binary RepresentationPython3EasyBit Manipulation
748Shortest Completing WordPython3EasyHash Table
747Largest Number At Least Twice of OthersPython3EasyArray
746Min Cost Climbing StairsPython3EasyArray, Dynamic Programming
744Find Smallest Letter Greater Than TargetPython3EasyBinary Search
733Flood FillPython3EasyDepth-first Search
728Self Dividing NumbersPython3EasyMath
724Find Pivot IndexPython3EasyArray
720Longest Word in DictionaryPython3EasyTrie, Hash Table
7171-bit and 2-bit CharactersPython3EasyArray
709To Lower CasePython3EasyString
706Design HashMapPython3EasyDesign, Hash Table
705Design HashSetPython3EasyDesign, Hash Table
704Binary SearchPython3EasyBinary Search
703Kth Largest Element in a StreamPython3EasyHeap
700Search in a Binary Search TreePython3EasyTree
697Degree of an ArrayPython3EasyArray
696Count Binary SubstringsPython3EasyString
693Binary Number with Alternating bitsPython3EasyBit Manipulation
690Employee ImportancePython3EasyDepth-first Search, Breadth-first Search, Hash Table
687Longest Univalue PathPython3EasyTree, Recursion
686Repeated String MatchPython3EasyString
682Baseball GamePython3EasyStack
680Valid Palindrome IIPython3EasyString
674Longest Continuous Increasing SubsequencePython3EasyArray
671Second Minimum Node in a Binary TreePython3EasyTree
669Trim a Binary Search TreePython3EasyTree
665Non-decreasing ArrayPython3EasyArray
661Image SmootherPython3EasyArray
657Robot Return to OriginPython3EasyString
653Two Sum IV - Input is a BSTPython3EasyTree
645Set MismatchPython3EasyHash Table, Math
643Maximum Average Subarray IPython3EasyArray
637Average of Levels in Binary TreePython3EasyTree
633Sum of Square NumbersPython3EasyMath
628Maximum Product of Three NumbersPython3EasyArray, Math
621Task SchedulerJava中等贪心, 数组, 哈希表, 计数, 排序, 堆(优先队列)
617Merge Two Binary TreesPython3EasyTree
606Construct String from Binary TreePython3EasyTree, String
605Can Place FlowersPython3EasyArray
599Minimum Index Sum of Two ListsPython3EasyHash Table
598Range Addition IIPython3EasyMath
594Longest Harmonious SubsequencePython3EasyHash Table
590N-ary Tree Postorder TraversalPython3EasyTree
589N-ary Tree Preorder TraversalPython3EasyTree
581Shortest Unsorted Continuous SubarrayPython3EasyArray
575Distribute CandiesPython3EasyHash Table
572Subtree of Another TreePython3EasyTree
566Reshape the MatrixPython3EasyArray
563Binary Tree TiltPython3EasyTree
561Array Partition IPython3EasyArray
559Maximum Depth of N-ary TreePython3EasyTree, Depth-first Search, Breadth-first Search
557Reverse Words in a String IIIPython3EasyString
551Student Attendance Record IPython3EasyTree
543Diameter of Binary TreePython3EasyTree
541Reverse String IIPython3EasyString
538Convert BST to Greater TreePython3EasyTree
532K-diff Pairs in an ArrayPython3EasyArray, Two Pointers
530Minimum Absolute Difference in BSTPython3EasyTree
521Longest Uncommon Subsequence IPython3EasyString
520Detect CapitalPython3EasyString
509Fibonacci NumberPython3EasyArray
507Perfect NumberPython3EasyMath
506Relative RanksPython3EasyNone
504Base 7Python3EasyNone
501Find Mode in Binary Search TreePython3EasyTree
500Keyboard RowPython3EasyHash Table
496Next Greater Element IPython3EasyStack
492Construct the RectanglePython3EasyNone
485Max Consecutive OnesPython3EasyArray
482License Key FormattingPython3EasyNone
476Number ComplementPython3EasyBit Manipulation
475HeatersPython3EasyBinary Search
463Island PerimeterPython3EasyHash Table
461Hamming DistancePython3, JavaEasyBit Manipulation
459Repeated Substring PatternPython3EasyString
455Assign CookiesPython3EasyGreedy
453Minimum Moves to Equal Array ElementsPython3EasyMath
448Find All Numbers Disappeared in an ArrayPython3EasyArray
447Number of BoomerangsPython3EasyHash Table
443String CompressionPython3EasyString
441Arranging CoinsPython3EasyMath, Binary Search
437Path Sum IIIPython3EasyTree
434Number of Segments in a StringPython3EasyString
415Add StringsPython3EasyString
414Third Maximum NumberPython3EasyArray
412Fizz BuzzPython3, JavaEasyNone
409Longest PalindromePython3EasyHash Table
405Convert a Number to HexadecimalPython3EasyBit Manipulation
403Sum of Left LeavesPython3EasyTree
401Binary WatchPython3EasyBit Manipulation, Backtracking
392Is SubsequencePython3EasyGreedy, Binary Search, Dynamic Programming
389Find the DifferencePython3EasyBit Manipulation, Hash Table
387First Unique CHaracter in a StringPython3, JavaEasyHash Table, String
384Shuffle an ArrayJavaMediumArray, Math, Randomized
383Ransom NotePython3EasyString
380Insert Delete GetRandom O(1)JavaMediumDesign, Array, Hash Table, Math, Randomized
374Guess Number Higher or LowerPython3EasyBinary Search
371Sum of Two IntegersPython3EasyBit Manipulation
367Valid Perfect SquarePython3EasyMath, Binary Search
350Intersection of Two Arrays IIPython3, JavaEasySort, Hash Table, Two Pointers, Binary Search
349Intersection of Two ArraysPython3EasySort, Hash Table, Two Pointers, Binary Search
347Top K Frequent ElementsJavaMediumArray, Hash Table, Divide and Conquer, Bucket Sort, Counting, Quickselect, Sorting, Heap(Priority Queue)
345Reverse Vowels of a StringPython3EasyTwo Pointers, String
344Reverse StringPython3, JavaEasyTwo Pointers, String
342Power of FourPython3EasyBit Manipulation
334Increasing Triplet SubsequenceJavaMediumGreedy, Array
328Odd Even Linked ListJavaMediumLinked List
326Power of ThreePython3, JavaEasyMath
322Coin ChangeJavaMediumBreadth-First, Array, Dynamic Programming
303Range Sum Query - ImmutablePython3EasyDynamic Programming
300Longest Increasing SubsequenceJavaMediumArray, Binary Search, Dynamic Programming
299Bulls and CowsPython3EasyHash Table
292Nim GamePython3EasyBrainteaser, Minimax
297Serialize and Deserialize Binary TreeJavaHardTree, Depth-First Search, Breadth-First Search, Design, String, Binary Tree
290Word PatternPython3EasyHash Table
283Move ZeroesPython3, JavaEasyArray, Two Pointers
278First Bad VersionPython3, JavaEasyBinary Search
268Missing NumberPython3, JavaEasyBit Manipulation, Array, Math
263Ugly NumberPython3EasyMath
258Add DigitsPython3EasyMath
257Binary Tree PathsPython3EasyTree, Depth-first Search
242Valid AnagramPython3, JavaEasySort, Hash Table
240Search a 2D Matrix IIJavaMediumArray, Binary Search, Divide and Conquer, Matrix
237Delete Node in a Linked ListPython3, JavaEasyLinked List
235Lowest Common Ancestor of a Binary Search TreePython3EasyTree
234Palindrome Linked ListPython3, JavaEasyLinked List, Two Pointers
232Implement Queue using StacksPython3EasyStack, Design
231Power of TwoPython3EasyBit Manipulation, Math
230Kth Smallest Element in a BSTJavaMediumTree, Depth-First Search, Binary Search Tree, Binary Tree
228Summary RangesPython3EasyArray
226Invert Binary TreePython3EasyTree
225Implement Stack using QueuesPython3EasyStack, Design
219Contains Duplicate IIPython3EasyArray, Hash Table
217Contains DuplicatePython3, JavaEasyArray, Hash Table
215Kth Largest Element in an ArrayJavaMediumArray, Divide and Conquer, Quickselect, Sorting, Heap(Priority Queue)
206Reverse Linked ListPython3, JavaEasyLinked List
205Isomorphic StringsPython3EasyHash Table
204Count PrimesPython3, JavaEasyHash Table, Math
203Remove Linked List ElementsPython3EasyLinked List
202Happy NumberPython3, JavaEasyHash Table, Math
200Number of IslandsJavaMediumDepth-First Search, Breadth-First Search, Union Find, Array, Matrix
198House RobberPython3, JavaEasyDynamic Programming
191Number of 1 BitsPython3, JavaEasyBit Manipulation
190Reverse BitsPython3, JavaEasyBit Manipulation
189Rotate ArrayPython3, JavaEasyArray
187Repeated DNA SequencesPython3MediumBit Manipulation, Hash Table, String, Sliding Windows, Hash Function, Rolling Hash
179Largest NumberPython3MediumGreedy, String, Sorting
173Binary Search Tree IteratorPython3MediumStack, Tree, Design, Binary Search Tree, Binary Tree, Iterator
172Factorial Trailing ZeroesPython3, JavaEasyMath
171Excel Sheet Column NumberPython3, JavaEasyMath
169Majority ElementPython3, JavaEasyBit Manipulation, Array, Divide and Conquer
168Excel Sheet Column TitlePython3EasyMath
167Two Sum II - Input Array is SortedPython3EasyArray, Two Pointers, Binary Search
166Fraction to Recurring DecimalPython3MediumHash Table, Math, String
165Compare Version NumbersPython3MediumString
162Find Peak ElementPython3, JavaMediumArray, Binary Search
160Intersection of Two Linked ListsPython3, JavaEasyLinked List
155Min StackPython3, JavaEasyStack, Design
153Find Minimum in Rotated Sorted ArrayPython3MediumArray, Binary Search
152Maximum Product SubarrayPython3MediumArray, Dynamic Programming
151Reverse Words in a StringPython3MediumString
150Evaluate Reverse Polish NotationPython3MediumStack
148Sort ListPython3MediumSort, Linked List
147Insertion Sort ListPython3MediumSort, Linked List
146LRU CachePython3MediumDesign
144Binary Tree Preorder TraversalPython3MediumStack, Tree
143Reorder ListPython3MediumLinked List
142Linked List Cycle IIPython3MediumLinked List, Two Pointers
141Linked List CyclePython3, JavaEasyLinked List, Two Pointers
139Word BreakPython3MediumDynamic Programming
138Copy List with Random PointerPython3MediumHash Table, Linked List
137Single Number IIPython3MediumBit Manipulation
136Single NumberPython3, JavaEasyBit Manipulation, Hash Table
134Gas StationPython3MediumGreedy
133Clone GraphPython3MediumDepth-first Search, Breadth-first Search, Graph
131Palindrome PartitioningPython3MediumDepth-first Search, Dynamic Programming, Backtracking
130Surrounded RegionsPython3MediumDepth-first Search, Breadth-first Search, Union Find
129Sum Root to Leaf NumbersPython3MediumTree, Depth-first Search
128Longest Consecutive SequencePython3MediumUnion Find, Array
125Valid PalindromePython3, JavaEasyTwo Pointers, String
122Best Time to Buy and Sell Stock IIPython3, JavaEasyGreedy, Array
121Best Time to Buy and Sell StockPython3, JavaEasyArray, Dynamic Programming
120TrianglePython3MediumArray, Dynamic Programming
119Pascal's Triangle IIPython3EasyArray
118Pascal's TrianglePython3, JavaEasyArray
117Populating Next Right Pointers in Each NodePython3MediumTree, Depth-first Search
116Populating Next Right Pointers in Each NodePython3, JavaMediumTree, Depth-first Search, Breadth-first Search
114Flatten Binary Tree to Linked ListPython3MediumTree, Depth-first Search
113Path Sum IIPython3MediumTree, Depth-first Search
112Path SumPython3EasyTree, Depth-first Search
111Minimum Depth of Binary TreePython3EasyTree, Depth-first Search, Breadth-first Search
110Balanced Binary TreePython3EasyTree, Depth-first Search
109Convert Sorted List to Binary Search TreePython3MediumDepth-first Search, Linked List
108Convert Sorted Array to Binary Search TreePython3, JavaEasyTree, Depth-first Search
107Binary Tree Level Order Traversal IIPython3EasyTree, Breadth-first Search
106Construct Binary Tree from Inorder and Postorder TraversalPython3MediumTree, Depth-first Search, Array
105Construct Binary Tree from Preorder and Inorder TraversalPython3, JavaMediumTree, Depth-first Search, Array
104Maximum Depth of Binary TreePython3, JavaEasyTree, Depth-first Search
103Binary Tree Zigzag Level Order TraversalJavaMediumTree, Breadth-First Search, Binary Tree
102Binary Tree Level Order TraversalPython3, JavaMediumTree, Breadth-first Search
101Symmetric TreePython3, JavaEasyTree, Depth-first Search, Breadth-first Search
100Same TreePython3EasyTree, Depth-first Search
98Validate Binary Search TreePython3, JavaMediumTree, Depth-first Search, Recursion
97Interleaving StringPython3MediumString, Dynamic Programming
96Unique Binary Search TreesPython3MediumTree, Dynamic Programming
95Unique Binary Search Trees IIPython3MediumTree, Dynamic Programming
94Binary Tree Inorder TraversalPython3, JavaMediumStack, Tree, Hash Table
93Restore IP AddressesPython3MediumString, Backtracking
92Reverse Linked List IIPython3MediumLinked List
91Decode WaysPython3MediumString, Dynamic Programming
90Subsets IIPython3MediumArray, Backtracking
89Gray CodePython3MediumBacktracking
88Merge Sorted ArrayPython3, JavaEasyArray, Two Pointers
86Partition ListPython3MediumLinked List, Two Pointers
83Remove Duplicates from Sorted ListPython3EasyLinked List
82Remove Duplicates from Sorted List IIPython3MediumLinked List
81Search in Rotated Sorted Array IIPython3MediumArray, Binary Search
80Remove Duplicates from Sorted Array IIPython3MediumArray, Two Pointers
79Word SearchPython3, JavaMediumArray, Backtracking
78SubsetsPython3, JavaMediumBit Manipulation, Array, Backtracking
77CombinationsPython3MediumBacktracking
75Sort ColorsPython3, JavaMediumSort, Array, Two Pointers
74Search a 2D MatrixPython3MediumArray, Binary Search
73Set Matrix ZeroesPython3, JavaMediumArray
71Simplify PathPython3MediumStack, String
70Climbing StairsPython3, JavaEasyDynamic Programming
69Sqrt(x)Python3, JavaEasyMath, Binary Search
67Add BinaryPython3EasyMath, String
66Plus OnePython3, JavaEasyArray
64Minimum Path SumPython3MediumArray, Dynamic Programming
63Unique Paths IIPython3MediumArray, Dynamic Programming
62Unique PathsPython3, JavaMediumArray, Dynamic Programming
61Rotate ListPython3MediumLinked List, Two Pointers
59Spiral Matrix IIPython3MediumArray
58Length of Last WordPython3EasyString
57Insert IntervalPython3MediumSort, Array
56Merge IntervalsPython3, JavaMediumSort, Array
55Jump GamePython3, JavaMediumGreedy, Array
54Spiral MatrixPython3MediumArray
53Maximum SubarrayPython3, JavaEasyArray, Divide and Conquer, Dynamic Programming
50Pow(x, n)Python3, JavaMediumMath, Binary Search
49Group AnagramsPython3, JavaMediumHash Table, String
48Rotate ImagePython3, JavaMediumArray
47Permutations IIPython3MediumBacktracking
46PermutationsPython3, JavaMediumBacktracking
45Jump Game IIPython3MediumGreedy, Array
43Multiply StringsPython3MediumMath, String
40Combination Sum IIPython3MediumArray, Backtracking
39Combination SumPython3MediumArray, Backtracking
38Count And SayPython3, JavaEasyString
36Valid SudokuPython3, JavaMediumHash Table
35Search Insert PositionPython3EasyArray, Binary Search
34Find First and Last Position of Element in Sorted ArrayPython3, JavaMediumArray, Binary Search
33Search in Rotated Sorted ArrayPython3, JavaMediumArray, Binary Search
31Next PermutationPython3MediumArray
29Divide Two IntegersPython3, JavaMediumMath, Binary Search
28Implement strStr()Python3, JavaEasyTwo Pointers, String
27Remove ElementPython3EasyArray, Two Pointers
26Remove Duplicates From Sorted ArrayPython3, JavaEasyArray, Two Pointers
24Swap Nodes in PairsPython3MediumRecursion, Linked List
22Generate ParenthesesPython3, JavaMediumString, Backtracking
21Merge Two Sorted ListsPython3, JavaEasyLinked List
20Valid ParenthesesPython3, JavaEasyStack, String
19Remove Nth Node From End of ListPython3, JavaMediumLinked List, Two Pointers
184SumPython3MediumArray, Hash Table, Two Pointers
17Letter Combinations of a Phone NumberPython3, JavaMediumDepth-first Search, Recursion, String, Backtracking
163Sum ClosestPython3MediumArray, Two Pointers
153SumPython3, JavaMediumArray, Two Pointers
14Longest Common PrefixPython3, JavaEasyString
13Roman to IntegerPython3, JavaEasyMath, String
12Integer to RomanPython3MediumMath, String
11Container With Most WaterPython3MediumArray, Two Pointers
9Palindrome NumberPython3EasyMath
8String to Integer (atoi)Python3, JavaMediumMath, String
7Reverse IntegerPython3, JavaEasyMath
6Zigzag ConversionPython3MediumString
5Longest Palindromic SubstringPython3, JavaMediumString, Dynamic Programming
3Longest Substring Without Repeating CharactersPython3, JavaMediumHash Table, Two Pointers, String, Sliding Window
2Add Two NumbersPython3, JavaMediumRecursion, Linked List, Math
1Two SumPython3, JavaEasyArray, Hash Table

Database

#TitleSolutionDifficulty
1179Reformat Department TableMySQLEasy
627Swap SalaryMySQLEasy
620Not Boring MoviesMySQLEasy
596Classes More Than 5 StudentsMySQLEasy
595Big CountriesMySQLEasy
197Rising TemperatureMySQLEasy
196Delete Duplicate EmailsMySQLEasy
184Department Highest SalaryMySQLMedium
183Customer Who Never OrderMySQLEasy
182Duplicate EmailsMySQLEasy
181Employees Earning More Than Their ManagersMySQLEasy
180Consecutive NumbersMySQLMedium
178Rank ScoresMySQLMedium
177Nth Highest SalaryMySQLMedium
176Second Highest SalaryMySQLEasy
175Combine Two TablesMySQLEasy

Shell

#TitleSolutionDifficulty
195Tenth LineBashEasy
194Transpose FileBashMedium
193Valid Phone NumberBashEasy
192Word FrequencyBashMedium

Concurrency

#TitleSolutionDifficulty
1114Print in OrderPython3Easy

About

My personal Leetcode problems' solutions

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages