Announcement

We have just launched Mock Interview, which presents you with a question to solve under time constraint just like a real interview.
Please note this is still at a very early stage, so if you have any suggestions/bug report please send it to us: admin@leetcode.com.

CONGRATULATIONS

You have confirmed your email successfully. Please read the FAQ or click here to complete your profile.

Welcome, ! You have solved problems. (manage sessions)

333 Largest BST Subtree 30.4% Medium
332 Reconstruct Itinerary 22.8% Medium
331 Verify Preorder Serialization of a Binary Tree 31.7% Medium
330 Patching Array 27.3% Medium
329 Longest Increasing Path in a Matrix 29.7% Medium
328 Odd Even Linked List 37.8% Easy
327 Count of Range Sum 24.3% Hard
326 Power of Three 35.3% Easy
325 Maximum Size Subarray Sum Equals k 38.5% Easy
324 Wiggle Sort II 20.9% Medium
323 Number of Connected Components in an Undirected Graph 42.7% Medium
322 Coin Change 24.6% Medium
321 Create Maximum Number 19.3% Hard
320 Generalized Abbreviation 39.5% Medium
319 Bulb Switcher 39.3% Medium
318 Maximum Product of Word Lengths 38.8% Medium
317 Shortest Distance from All Buildings 29.9% Hard
316 Remove Duplicate Letters 23.6% Medium
315 Count of Smaller Numbers After Self 28.6% Hard
314 Binary Tree Vertical Order Traversal 30.2% Medium
313 Super Ugly Number 31.8% Medium
312 Burst Balloons 33.9% Hard
311 Sparse Matrix Multiplication 46.8% Medium
310 Minimum Height Trees 25.8% Medium
309 Best Time to Buy and Sell Stock with Cooldown 35.4% Medium
308 Range Sum Query 2D - Mutable 21.3% Hard
307 Range Sum Query - Mutable 16.8% Medium
306 Additive Number 24.6% Medium
305 Number of Islands II 33.2% Hard
304 Range Sum Query 2D - Immutable 21.6% Medium
303 Range Sum Query - Immutable 24.3% Easy
302 Smallest Rectangle Enclosing Black Pixels 37.9% Hard
301 Remove Invalid Parentheses 30.8% Hard
300 Longest Increasing Subsequence 33.2% Medium
299 Bulls and Cows 28.4% Easy
298 Binary Tree Longest Consecutive Sequence 35.0% Medium
297 Serialize and Deserialize Binary Tree 26.3% Medium
296 Best Meeting Point 45.6% Hard
295 Find Median from Data Stream 21.3% Hard
294 Flip Game II 40.3% Medium
293 Flip Game 48.8% Easy
292 Nim Game 51.0% Easy
291 Word Pattern II 33.5% Hard
290 Word Pattern 27.9% Easy
289 Game of Life 33.3% Medium
288 Unique Word Abbreviation 15.6% Easy
287 Find the Duplicate Number 37.6% Hard
286 Walls and Gates 36.0% Medium
285 Inorder Successor in BST 35.0% Medium
284 Peeking Iterator 32.8% Medium
283 Move Zeroes 43.2% Easy
282 Expression Add Operators 23.2% Hard
281 Zigzag Iterator 41.0% Medium
280 Wiggle Sort 49.0% Medium
279 Perfect Squares 31.2% Medium
278 First Bad Version 21.8% Easy
277 Find the Celebrity 35.0% Medium
276 Paint Fence 30.0% Easy
275 H-Index II 32.2% Medium
274 H-Index 28.5% Medium
273 Integer to English Words 17.9% Medium
272 Closest Binary Search Tree Value II 31.5% Hard
271 Encode and Decode Strings 27.0% Medium
270 Closest Binary Search Tree Value 32.9% Easy
269 Alien Dictionary 21.7% Hard
268 Missing Number 39.0% Medium
267 Palindrome Permutation II 26.6% Medium
266 Palindrome Permutation 49.6% Easy
265 Paint House II 34.4% Hard
264 Ugly Number II 26.4% Medium
263 Ugly Number 35.7% Easy
261 Graph Valid Tree 30.8% Medium
260 Single Number III 42.4% Medium
259 3Sum Smaller 37.6% Medium
258 Add Digits 48.0% Easy
257 Binary Tree Paths 26.9% Easy
256 Paint House 41.6% Medium
255 Verify Preorder Sequence in Binary Search Tree 36.0% Medium
254 Factor Combinations 33.6% Medium
253 Meeting Rooms II 33.3% Medium
252 Meeting Rooms 40.8% Easy
251 Flatten 2D Vector 32.4% Medium
250 Count Univalue Subtrees 35.3% Medium
249 Group Shifted Strings 30.7% Easy
248 Strobogrammatic Number III 25.2% Hard
247 Strobogrammatic Number II 32.8% Medium
246 Strobogrammatic Number 35.3% Easy
245 Shortest Word Distance III 45.6% Medium
244 Shortest Word Distance II 35.0% Medium
243 Shortest Word Distance 45.6% Easy
242 Valid Anagram 40.6% Easy
241 Different Ways to Add Parentheses 32.7% Medium
240 Search a 2D Matrix II 33.2% Medium
239 Sliding Window Maximum 26.0% Hard
238 Product of Array Except Self 41.2% Medium
237 Delete Node in a Linked List 43.7% Easy
236 Lowest Common Ancestor of a Binary Tree 28.5% Medium
235 Lowest Common Ancestor of a Binary Search Tree 38.0% Easy
234 Palindrome Linked List 26.7% Easy
233 Number of Digit One 23.7% Medium
232 Implement Queue using Stacks 33.9% Easy
231 Power of Two 34.9% Easy
230 Kth Smallest Element in a BST 35.8% Medium
229 Majority Element II 25.1% Medium
228 Summary Ranges 22.9% Easy
227 Basic Calculator II 23.6% Medium
226 Invert Binary Tree 43.6% Easy
225 Implement Stack using Queues 30.4% Easy
224 Basic Calculator 20.9% Medium
223 Rectangle Area 29.0% Easy
222 Count Complete Tree Nodes 24.0% Medium
221 Maximal Square 22.7% Medium
220 Contains Duplicate III 18.1% Medium
219 Contains Duplicate II 29.0% Easy
218 The Skyline Problem 21.0% Hard
217 Contains Duplicate 40.1% Easy
216 Combination Sum III 34.1% Medium
215 Kth Largest Element in an Array 31.6% Medium
214 Shortest Palindrome 18.8% Hard
213 House Robber II 29.5% Medium
212 Word Search II 18.1% Hard
211 Add and Search Word - Data structure design 20.3% Medium
210 Course Schedule II 20.7% Medium
209 Minimum Size Subarray Sum 26.0% Medium
208 Implement Trie (Prefix Tree) 25.2% Medium
207 Course Schedule 25.8% Medium
206 Reverse Linked List 37.9% Easy
205 Isomorphic Strings 28.5% Easy
204 Count Primes 23.2% Easy
203 Remove Linked List Elements 27.8% Easy
202 Happy Number 35.5% Easy
201 Bitwise AND of Numbers Range 29.2% Medium
200 Number of Islands 26.5% Medium
199 Binary Tree Right Side View 32.7% Medium
198 House Robber 33.1% Easy
191 Number of 1 Bits 37.6% Easy
190 Reverse Bits 29.1% Easy
189 Rotate Array 20.3% Easy
188 Best Time to Buy and Sell Stock IV 21.3% Hard
187 Repeated DNA Sequences 23.9% Medium
186 Reverse Words in a String II 29.8% Medium
179 Largest Number 18.2% Medium
174 Dungeon Game 20.1% Hard
173 Binary Search Tree Iterator 33.1% Medium
172 Factorial Trailing Zeroes 31.7% Easy
171 Excel Sheet Column Number 40.2% Easy
170 Two Sum III - Data structure design 24.2% Easy
169 Majority Element 39.7% Easy
168 Excel Sheet Column Title 20.7% Easy
167 Two Sum II - Input array is sorted 47.0% Medium
166 Fraction to Recurring Decimal 14.5% Medium
165 Compare Version Numbers 16.8% Easy
164 Maximum Gap 26.1% Hard
163 Missing Ranges 28.1% Medium
162 Find Peak Element 32.7% Medium
161 One Edit Distance 27.5% Medium
160 Intersection of Two Linked Lists 30.0% Easy
159 Longest Substring with At Most Two Distinct Characters 33.4% Hard
158 Read N Characters Given Read4 II - Call multiple times 23.0% Hard
157 Read N Characters Given Read4 29.2% Easy
156 Binary Tree Upside Down 37.1% Medium
155 Min Stack 21.5% Easy
154 Find Minimum in Rotated Sorted Array II 33.7% Hard
153 Find Minimum in Rotated Sorted Array 35.4% Medium
152 Maximum Product Subarray 21.5% Medium
151 Reverse Words in a String 15.6% Medium
150 Evaluate Reverse Polish Notation 22.9% Medium
149 Max Points on a Line 14.0% Hard
148 Sort List 24.1% Medium
147 Insertion Sort List 28.6% Medium
146 LRU Cache 15.7% Hard
145 Binary Tree Postorder Traversal 34.6% Hard
144 Binary Tree Preorder Traversal 38.8% Medium
143 Reorder List 22.2% Medium
142 Linked List Cycle II 31.5% Medium
141 Linked List Cycle 36.8% Medium
140 Word Break II 19.1% Hard
139 Word Break 24.5% Medium
138 Copy List with Random Pointer 25.9% Hard
137 Single Number II 36.8% Medium
136 Single Number 48.5% Medium
135 Candy 21.9% Hard
134 Gas Station 26.8% Medium
133 Clone Graph 24.7% Medium
132 Palindrome Partitioning II 21.2% Hard
131 Palindrome Partitioning 27.4% Medium
130 Surrounded Regions 15.7% Medium
129 Sum Root to Leaf Numbers 31.9% Medium
128 Longest Consecutive Sequence 31.3% Hard
127 Word Ladder 19.6% Medium
126 Word Ladder II 13.5% Hard
125 Valid Palindrome 23.2% Easy
124 Binary Tree Maximum Path Sum 22.8% Hard
123 Best Time to Buy and Sell Stock III 25.6% Hard
122 Best Time to Buy and Sell Stock II 41.2% Medium
121 Best Time to Buy and Sell Stock 35.1% Medium
120 Triangle 29.3% Medium
119 Pascal's Triangle II 31.4% Easy
118 Pascal's Triangle 32.4% Easy
117 Populating Next Right Pointers in Each Node II 32.6% Hard
116 Populating Next Right Pointers in Each Node 36.4% Medium
115 Distinct Subsequences 28.2% Hard
114 Flatten Binary Tree to Linked List 30.3% Medium
113 Path Sum II 27.7% Medium
112 Path Sum 30.8% Easy
111 Minimum Depth of Binary Tree 30.1% Easy
110 Balanced Binary Tree 33.4% Easy
109 Convert Sorted List to Binary Search Tree 29.7% Medium
108 Convert Sorted Array to Binary Search Tree 36.3% Medium
107 Binary Tree Level Order Traversal II 33.0% Easy
106 Construct Binary Tree from Inorder and Postorder Traversal 28.4% Medium
105 Construct Binary Tree from Preorder and Inorder Traversal 27.8% Medium
104 Maximum Depth of Binary Tree 47.1% Easy
103 Binary Tree Zigzag Level Order Traversal 27.9% Medium
102 Binary Tree Level Order Traversal 31.6% Easy
101 Symmetric Tree 33.2% Easy
100 Same Tree 42.7% Easy
99 Recover Binary Search Tree 25.8% Hard
98 Validate Binary Search Tree 20.6% Medium
97 Interleaving String 22.0% Hard
96 Unique Binary Search Trees 36.7% Medium
95 Unique Binary Search Trees II 28.8% Medium
94 Binary Tree Inorder Traversal 38.6% Medium
93 Restore IP Addresses 22.7% Medium
92 Reverse Linked List II 27.2% Medium
91 Decode Ways 17.1% Medium
90 Subsets II 29.7% Medium
89 Gray Code 35.3% Medium
88 Merge Sorted Array 29.7% Easy
87 Scramble String 26.0% Hard
86 Partition List 28.8% Medium
85 Maximal Rectangle 23.0% Hard
84 Largest Rectangle in Histogram 23.7% Hard
83 Remove Duplicates from Sorted List 36.1% Easy
82 Remove Duplicates from Sorted List II 26.3% Medium
81 Search in Rotated Sorted Array II 31.6% Medium
80 Remove Duplicates from Sorted Array II 32.0% Medium
79 Word Search 22.2% Medium
78 Subsets 30.4% Medium
77 Combinations 33.2% Medium
76 Minimum Window Substring 20.5% Hard
75 Sort Colors 34.1% Medium
74 Search a 2D Matrix 33.2% Medium
73 Set Matrix Zeroes 32.9% Medium
72 Edit Distance 27.9% Hard
71 Simplify Path 21.3% Medium
70 Climbing Stairs 36.1% Easy
69 Sqrt(x) 24.7% Medium
68 Text Justification 15.7% Hard
67 Add Binary 26.5% Easy
66 Plus One 32.6% Easy
65 Valid Number 11.9% Hard
64 Minimum Path Sum 34.0% Medium
63 Unique Paths II 28.9% Medium
62 Unique Paths 35.3% Medium
61 Rotate List 22.5% Medium
60 Permutation Sequence 24.4% Medium
59 Spiral Matrix II 34.0% Medium
58 Length of Last Word 28.6% Easy
57 Insert Interval 23.2% Hard
56 Merge Intervals 24.4% Hard
55 Jump Game 27.8% Medium
54 Spiral Matrix 21.9% Medium
53 Maximum Subarray 36.0% Medium
52 N-Queens II 38.3% Hard
51 N-Queens 26.2% Hard
50 Pow(x, n) 27.9% Medium
49 Group Anagrams 26.4% Medium
48 Rotate Image 33.9% Medium
47 Permutations II 27.3% Medium
46 Permutations 34.5% Medium
45 Jump Game II 24.9% Hard
44 Wildcard Matching 16.9% Hard
43 Multiply Strings 22.7% Medium
42 Trapping Rain Water 31.6% Hard
41 First Missing Positive 23.5% Hard
40 Combination Sum II 26.9% Medium
39 Combination Sum 30.0% Medium
38 Count and Say 27.8% Easy
37 Sudoku Solver 24.0% Hard
36 Valid Sudoku 29.6% Easy
35 Search Insert Position 36.7% Medium
34 Search for a Range 28.5% Medium
33 Search in Rotated Sorted Array 29.8% Hard
32 Longest Valid Parentheses 22.1% Hard
31 Next Permutation 25.9% Medium
30 Substring with Concatenation of All Words 20.4% Hard
29 Divide Two Integers 15.4% Medium
28 Implement strStr() 24.1% Easy
27 Remove Element 32.9% Easy
26 Remove Duplicates from Sorted Array 32.7% Easy
25 Reverse Nodes in k-Group 26.8% Hard
24 Swap Nodes in Pairs 34.4% Medium
23 Merge k Sorted Lists 22.7% Hard
22 Generate Parentheses 35.6% Medium
21 Merge Two Sorted Lists 34.5% Easy
20 Valid Parentheses 28.5% Easy
19 Remove Nth Node From End of List 28.6% Easy
18 4Sum 23.1% Medium
17 Letter Combinations of a Phone Number 27.7% Medium
16 3Sum Closest 28.3% Medium
15 3Sum 18.2% Medium
14 Longest Common Prefix 27.3% Easy
13 Roman to Integer 37.8% Easy
12 Integer to Roman 37.3% Medium
11 Container With Most Water 33.8% Medium
10 Regular Expression Matching 21.5% Hard
9 Palindrome Number 30.7% Easy
8 String to Integer (atoi) 13.3% Easy
7 Reverse Integer 23.5% Easy
6 ZigZag Conversion 23.2% Easy
5 Longest Palindromic Substring 22.3% Medium
4 Median of Two Sorted Arrays 18.1% Hard
3 Longest Substring Without Repeating Characters 21.4% Medium
2 Add Two Numbers 22.1% Medium
1 Two Sum 21.0% Medium
Send Feedback