Leetcode order table

Source: Internet
Author: User
ID Question Difficulty Frequency Data Structures Algorithms
1 Two sum 2 5 Array + set Sort + two pointers
2 Add two numbers 3 4 Linked List Two pointers + math
3 Longest substring without repeating characters 3 2 String + hashtable Two pointers
4 Median of two sorted Arrays 5 3 Array Binary Search
5 Longest palindromic substring 4 2 String  
6 Zigzag Conversion 3 1 String  
7 Reverse integer 2 3   Math
8 String to INTEGER (atoi) 2 5 String Math
9 Palindrome number 2 2   Math
10 Regular Expression matching 5 3 String Recursion + dp
11 Container with most water 3 2 Array Two pointers
12 Integer to Roman 3 4   Math
13 Roman to integer 2 4   Math
14 Longest Common prefix 2 1 String  
15 3sum 3 5 Array Two pointers
16 3sum closest 3 1 Array Two pointers
17 Letter combinations of a phone number 3 3 String DFS
18 4Sum 3 2 Array  
19 Remove nth node from end of list 2 3 Linked List Two pointers
20 Valid parentheses 2 5 String Stack
21 Merge two sorted lists 2 5 Linked List Sort + two pointers + merge
22 Generate parentheses 3 4 String DFS
23 Merge K sorted lists 3 4 Linked List + heap Sort + two pointers + merge
24 Swap nodes in pairs 2 4 Linked List  
25 Reverse nodes in K-group 4 2 Linked List Recursion + two pointers
26 Remove duplicates from sorted Array 1 3 Array Two pointers
27 Remove Element 1 4 Array Two pointers
28 Implement strstr () 4 5 String Two pointers + KMP + rolling hash
29 Divide two integers 4 3   Binary Search + math
30 Substring with concatenation of all words 3 1 String Two pointers
31 Next Permutation 5 2 Array Permutation
32 Longest valid parentheses 4 1 String DP
33 Search in rotated sorted Array 4 3 Array Binary Search
34 Search for a Range 4 3 Array Binary Search
35 Search insert position 2 2 Array  
36 Valid Sudoku 2 2 Array  
37 Sudoku Solver 4 2 Array DFS
38 Count and say 2 2 String Two pointers
39 Combination sum 3 3 Array Combination
40 Combination sum II 4 2 Array Combination
41 First missing positive 5 2 Array Sort
42 Trapping rain water 4 2 Array Two pointers + Stack
43 Multiply strings 4 3 String Two pointers + math
44 Wildcard matching 5 3 String Recursion + dp + greedy
45 Jump Game II 4 2 Array  
46 Permutations 3 4 Array Permutation
47 Permutations II 4 2 Array Permutation
48 Rotate Image 4 2 Array  
49 Anagrams 3 4 String + hashtable  
50 Pow (x, n) 3 5   Binary Search + math
51 N-queens 4 3 Array DFS
52 N-Queens II 4 3 Array DFS
53 Maximum subarray 3 3 Array DP
54 Spiral Matrix 4 2 Array  
55 Jump game 3 2 Array  
56 Merge intervals 4 5 Array + linked list + red-black tree Sort + merge
57 Insert Interval 4 5 Array + linked list + red-black tree Sort + merge
58 Length of last word 1 1 String  
59 Spiral matrix II 3 2 Array  
60 Permutation sequence 5 1   Permutation + math
61 Rotate list 3 2 Linked List Two pointers
62 Unique paths 2 3 Array DP
63 Unique paths II 3 3 Array DP
64 Minimum path sum 3 3 Array DP
65 Valid number 2 5 String Math
66 Plus one 1 2 Array Math
67 Add binary 2 4 String Two pointers + math
68 Text justification 4 2 String  
69 SQRT (X) 4 4   Binary Search
70 Climbing stairs 2 5   DP
71 Simplify path 3 1 String Stack
72 Edit distance 4 3 String DP
73 Set matrix zeroes 3 5 Array  
74 Search a 2D matrix 3 3 Array Binary Search
75 Sort colors 4 2 Array Sort + two pointers
76 Minimum window substring 4 2 String Two pointers
77 Combinations 3 4   Combination
78 Subsets 3 4 Array Recursion + combination
79 Word search 3 4 Array DFS
80 Remove duplicates from sorted array II 2 2 Array Two pointers
81 Search in rotated sorted array II 5 3 Array Binary Search
82 Remove duplicates from sorted List II 3 3 Linked List Recursion + two pointers
83 Remove duplicates from sorted list 1 3 Linked List  
84 Largest rectangle in Histogram 5 2 Array Stack
85 Maximal rectangle 5 1 Array DP + Stack
86 Partition list 3 3 Linked List Two pointers
87 Scramble string 5 2 String Recursion + dp
88 Merge sorted Array 2 5 Array Two pointers + merge
89 Gray Code 4 2   Combination
90 Subsets II 4 2 Array Recursion + combination
91 Decode ways 3 4 String Recursion + dp
92 Reverse Linked List II 3 2 Linked List Two pointers
93 Restore IP addresses 3 3 String DFS
94 Binary Tree inorder Traversal 4 3 Tree + hashtable Recursion + Morris + Stack
95 Unique Binary Search Trees II 4 1 Tree DP + DFS
96 Unique Binary Search Trees 3 1 Tree DP
97 Interleaving string 5 2 String Recursion + dp
98 Validate Binary Search Tree 3 5 Tree DFS
99 Recover Binary Search Tree 4 2 Tree DFS
100 Same Tree 1 1 Tree DFS
101 Symmetric tree 1 2 Tree DFS
102 Binary Tree level order traversal 3 4 Tree BFS
103 Binary Tree zigzag level order traversal 4 3 Queue + tree BFS + Stack
104 Maximum depth of Binary Tree 1 1 Tree DFS
105 Construct binary tree from preorder and inorder tr 3 3 Array + tree DFS
106 Construct binary tree from inorder and postorder t 3 3 Array + tree DFS
107 Binary Tree level order traversal II 3 1 Tree BFS
108 Convert sorted array to Binary Search Tree 2 3 Tree DFS
109 Convert sorted list to Binary Search Tree 4 3 Linked List Recursion + two pointers
110 Balanced Binary Tree 1 2 Tree DFS
111 Minimum depth of Binary Tree 1 1 Tree DFS
112 Path sum 1 3 Tree DFS
113 Path sum II 2 2 Tree DFS
114 Flatten binary tree to linked list 3 3 Tree Recursion + Stack
115 Distinct subsequences 4 2 String DP
116 Populating next right pointers in each node 3 3 Tree DFS
117 Populating next right pointers in each node II 4 2 Tree DFS
118 Pascal's Triangle 2 1 Array  
119 Pascal's triangle II 2 1 Array  
120 Triangle 3 1 Array DP
121 Best time to buy and buy stock 2 1 Array DP
122 Best time to buy and stock Stock II 3 1 Array Greedy
123 Best time to buy and buy stock III 4 1 Array DP
124 Binary Tree maximum path sum 4 2 Tree DFS
125 Valid palindrome 2 5 String Two pointers
126 Word ladder II 1 1    
127 Word ladder 3 5 Graph BFS + Shortest Path
128 Longest consecutive sequence 4 3 Array  
129 Sum root to leaf numbers 2 4 Tree DFS
130 Surrounded regions 4 3 Array BFS + DFS
131 Palindrome partitioning 3 4 String DFS
132 Palindrome partitioning II 4 3 String DP

Leetcode order table

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.