Leetcode难度表及解题汇总

本文汇总了LeetCode中的题目难度,并结合作者的解题经验,为读者提供了一份详细的解题攻略。内容包括不同难度级别的题目推荐,以及解题技巧的实战分享。

Leetcode难度表及解题汇总

参考网上一份题目难度表,以及本人的解题。

IdQuestionDifficultyFrequencyData StructuresAlgorithmsBlogComment
1Two Sum25array+setsort+2ptr
2Add Two Numbers34linkedlistmath+2ptrLeetcode解题-链表(2.2.1)AddTwoNumbers
3Longest Substring Without Repeating Characters32string+hashtable2ptr
4Median of Two Sorted Arrays53arraybinary search
5Longest Palindromic Substring42string
6ZigZag Conversion31string
7Reverse Integer23math
8String to Integer (atoi)25stringmath
9Palindrome Number22math
10Regular Expression Matching53stringrecursion+dp
11Container With Most Water32array2ptr
12Integer to Roman34math
13Roman to Integer24math
14Longest Common Prefix21string
153Sum35array2ptr
163Sum Closest31array2ptr
17Letter Combinations of a Phone Number33stringdfs
184Sum32array
19Remove Nth Node From End of List23linkedlist2ptr
20Valid Parentheses25stringstack
21Merge Two Sorted Lists25linkedlistsort+2ptr+merge
22Generate Parentheses34stringdfs
23Merge k Sorted Lists34linkedlist+heapsort+2ptr+merge
24Swap Nodes in Pairs24linkedlist
25Reverse Nodes in k-Group42linkedlistrecursion+2ptr
26Remove Duplicates from Sorted Array13array2ptr
27Remove Element14array2ptr
28Implement strStr()45string2ptr+KMP+rolling hash
29Divide Two Integers43binary search+math
30Substring with Concatenation of All Words31string2ptr
31Next Permutation52arraypermutation
32Longest Valid Parentheses41stringdp
33Search in Rotated Sorted Array43arraybinary search
34Search for a Range43arraybinary search
35Search Insert Position22array
36Valid Sudoku22array
37Sudoku Solver42arraydfs
38Count and Say22string2ptr
39Combination Sum33arraycombination
40Combination Sum II42arraycombination
41First Missing Positive52arraysort
42Trapping Rain Water42array2ptr+stack
43Multiply Strings43string2ptr+math
44Wildcard Matching53stringrecursion+dp+greedy
45Jump Game II42array
46Permutations34arraypermutation
47Permutations II42array
48Rotate Image42array
49Anagrams34string+hashtable
50Pow(x, n)35binary search+math
51N-Queens43arraydfs
52N-Queens II43arraydfs
53Maximum Subarray33arraydp
54Spiral Matrix42array
55Jump Game32array
56Merge Intervals45array+linkedlist+red-black treesort+merge
57Insert Interval45array+linkedlist+red-black treesort+merge
58Length of Last Word11string
59Spiral Matrix II32array
60Permutation Sequence51permutation+math
61Rotate List32linkedlist2ptrLeetcode解题-链表(2.2.6)RotateList
62Unique Paths23arraydp
63Unique Paths II33arraydp
64Minimum Path Sum33arraymath
65Valid Number25stringmath
66Plus One12arraymath
67Add Binary24string2ptr+math
68Text Justification42string
69Sqrt(x)44binary search
70Climbing Stairs25dp
71Simplify Path31stringstack
72Edit Distance43stringdp
73Set Matrix Zeroes35array
74Search a 2D Matrix33arraybinary search
75Sort Colors42arraysort+2ptr
76Minimum Window Substring42string2ptr
77Combinations34combination
78Subsets34arrayrecursion+combination
79Word Search34arraydfs
80Remove Duplicates from Sorted Array II22arraybinary search
81Search in Rotated Sorted Array II53arraybinary search
82Remove Duplicates from Sorted List II33linkedlistrecursion+2ptr
83Remove Duplicates from Sorted List13linkedlist
84Largest Rectangle in Histogram52arraystack
85Maximal Rectangle51arraydp+stack
86Partition List33linkedlist2ptrLeetcode解题-链表(2.2.3)PartitionList
87Scramble String52stringrecursion+dp
88Merge Sorted Array25array2ptr+merge
89Gray Code42combination
90Subsets II42arrayrecursion+combination
91Decode Ways34stringrecursion+dp
92Reverse Linked List II32linkedlist2ptr
93Restore IP Addresses33stringdfs
94Binary Tree Inorder Traversal43tree+hashtablerecursion+morris+stack
95Unique Binary Search Trees II41treedp+dfs
96Unique Binary Search Trees31treedp
97Interleaving String52stringrecursion+dp
98Validate Binary Search Tree35treedfs
99Recover Binary Search Tree42treedfs
100Same Tree11treedfs
101Symmetric Tree12treedfs
102Binary Tree Level Order Traversal34treedfs
103Binary Tree Zigzag Level Order Traversal43queue+treebfs+stack
104Maximum Depth of Binary Tree11treedfs
105Construct Binary Tree from Preorder and Inorder33array+treedfs
106Construct Binary Tree from Inorder and Postorder33array+treedfs
107Binary Tree Level Order Traversal II31treebfs
108Convert Sorted Array to Binary Search Tree23treedfs
109Convert Sorted List to Binary Search Tree43linkedlistrecursion+2ptr
110Balanced Binary Tree12treedfs
111Minimum Depth of Binary Tree11treedfs
112Path Sum13treedfs
113Path Sum II22treedfs
114Flatten Binary Tree to Linked List33treerecursion+stack
115Distinct Subsequences42stringdp
116Populating Next Right Pointers in Each Node33treedfs
117Populating Next Right Pointers in Each Node II42treedfs
118Pascal’s Triangle21array
119Pascal’s Triangle II21array
120Triangle31arraydp
121Best Time to Buy and Sell Stock21arraydp
122Best Time to Buy and Sell Stock II31arraygreedy
123Best Time to Buy and Sell Stock III41arraydp
124Binary Tree Maximum Path Sum42treedfs
125Valid Palindrome25string2ptr
126Word Ladder II11
127Word Ladder35graphbfs+shortest path
128Longest Consecutive Sequence43array
129Sum Root to Leaf Numbers24treedfs
130Surrounded Regions43arraybfs+dfs
131Palindrome Partitioning34stringdfs
132Palindrome Partitioning II43stringdp
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值