LeetCode Top 100 Liked Questions | LeetCode 热题 HOT 100

By Long Luo

The Solutions of LeetCode热题 100 | Top 100 Liked Questions:

No.ProblemsDifficultySource CodeSolution
001Two SumEasyJava2种方法:暴力 和 HashMap
002Add Two NumbersMediumJava2种方法:模拟 和 递归
003Longest Substring Without Repeating CharactersMediumJava
004Median of Two Sorted ArraysHardJava4种方法:合并数组,暴力法,二分搜索,划分数组
005Longest Palindromic SubstringMediumJava
010Regular Expression MatchingHardJava
011Container With Most WaterMediumJava2 Approaches: BF and Two Pointers with Image Explaination
017Letter Combinations of a Phone NumberMediumJava4 Approaches: BF 4 Loops, Backtracking, BFS, Queue with Image Explaination
019Remove Nth Node From End of ListEasyJava
020Valid ParenthesesEasyJava
021Merge Two Sorted ListsEasyJava
022Generate ParenthesesMediumJava2种方法:暴力法 和 回溯法
023Merge k Sorted ListsHardJava
024Swap Nodes in PairsMediumJava
025Reverse Nodes in k-GroupHardJava
031Next PermutationMediumJavaTwo Pointers Solution with Detailed Explanation and Code Commented
032Longest Valid ParenthesesHardJava
033Search in Rotated Sorted ArrayMediumJava
034Search for a RangeMediumJava
035Search Insert PositionMediumJava
039Combination SumMediumJava
042Trapping Rain WaterHardJava
045Jump Game IIMediumJava
048Rotate ImageMediumJava
049Group AnagramsMediumJava
053Maximum SubarrayMediumJava
055Jump GameMediumJava
056Merge IntervalsMediumJava
062Unique PathsMediumJava
064Minimum Path SumMediumJava
070Climbing StairsEasyJava
072Edit DistanceHardJava
075Sort ColorsMediumJava
076Minimum Window SubstringHardJava
079Word SearchMediumJava
084Largest Rectangle in HistogramHardJava
085Maximal RectangleHardJava
094Binary Tree Inorder TraversalMediumJava
096Unique Binary Search TreesMediumJava
098Validate Binary Search TreeMediumJava
101Symmetric TreeEasyJava
102Binary Tree Level Order TraversalEasyJava
104Maximum Depth of Binary TreeEasyJava
105Construct Binary Tree from Preorder and Inorder TraversalMediumJava
114Flatten Binary Tree to Linked ListMediumJava
121Best Time to Buy and Sell StockEasyJava
128Longest Consecutive SequenceHardJava
136Single NumberEasyJava
139Word BreakMediumJava
141Linked List CycleEasyJava
142Linked List Cycle IIMediumJava
146LRU CacheHardJava
148Sort ListMediumJava
152Maximum Product SubarrayMediumJava
155Min StackEasyJava3种方法:辅助栈,栈,链表
160Intersection of Two Linked ListsEasyJava
169Majority ElementEasyJava
198House RobberEasyJava
200Number of IslandsMediumJava
206Reverse Linked ListEasyJava
207Course ScheduleMediumJava
208Implement Trie (Prefix Tree)MediumJava
210Course Schedule IIMediumJava
215Kth Largest Element in an ArrayMediumJava
221Maximal SquareMediumJava
226Invert Binary TreeEasyJava
230Kth Smallest Element in a BSTMediumJava
234Palindrome Linked ListEasyJava
238Product of Array Except SelfMediumJava
239Sliding Window MaximumHardJava
240Search a 2D Matrix IIMediumJava
253Meeting Rooms IIMedium没权限
279Perfect SquaresMediumJava
283Move ZeroesEasyJava
287Find the Duplicate NumberMediumJava9 Approaches: Count, Hash, Sort, Binary Search, Bit, Fast Slow Pointers
297Serialize and Deserialize Binary TreeHardJava
300Longest Increasing SubsequenceMediumJava
301Remove Invalid ParenthesesHardJava
309Best Time to Buy and Sell Stock with CooldownMediumJava
312Burst BalloonsHardJava
322Coin ChangeMediumJava
328Odd Even Linked ListMediumJava
337House Robber IIIMediumJava
338Counting BitsMediumJava
347Top K Frequent ElementsMediumJava
394Decode StringMediumJava
399Evaluate DivisionMediumJava
406Queue Reconstruction by HeightMediumJava
416Partition Equal Subset SumMediumJava
437Path Sum IIIEasyJava
438Find All Anagrams in a StringEasyJava滑动窗口:从HashMap,数组,再到统计字母数量之差
448Find All Numbers Disappeared in an ArrayEasyJava
461Hamming DistanceEasyJava
494Target SumMediumJava
538Convert BST to Greater TreeEasyJava
543Diameter of Binary TreeEasyJava
560Subarray Sum Equals KMediumJava
572Subtree of Another TreeEasyJava
581Shortest Unsorted Continuous SubarrayEasyJava
617Merge Two Binary TreesEasyJava4 Approaches: Recursion, Iteration, BFS and DFS
621Task SchedulerMediumJava
647Palindromic SubstringsMediumJava
739Daily TemperaturesMediumJava
763Partition LabelsMediumJavaIllustration of the Max Position of the Char in the Partition with Easy Detailed Explanation