[置顶]  

LeetCode Algorithms' Solutions


Talk is cheap, show me the code!
Linus Torvalds

  • 如果题解中有谬误或疑问的地方,欢迎大家留言交流!
# Title Acceptance Difficulty
1 Two Sum 36.6%

1

Easy
2 Add Two Numbers 28.2%

2

Medium
7 Reverse Integer 24.4%

1

Easy
8 String to Integer (atoi) 13.9%

2

Medium
9 Palindrome Number 35.6%

1

Easy
13 Roman to Integer 47.1%

1

Easy
20 Valid Parentheses 33.7%

1

Easy
21 Merge Two Sorted Lists 39.7%

1

Easy
27 Remove Element 40.1%

1

Easy
28 Implement strStr() 28.7%

1

Easy
35 Search Insert Position 39.9%

1

Easy
50 Pow(x, n) 26.0%

2

Medium
53 Maximum Subarray 40.0%

1

Easy
69 Sqrt(x) 28.4%

1

Easy
70 Climbing Stairs 40.7%

1

Easy
83 Remove Duplicates from Sorted List 40.1%

1

Easy
84 Largest Rectangle in Histogram 27.3%

3

Hard
100 Same Tree 47.2%

1

Easy
101 Symmetric Tree 39.7%

1

Easy
102 Binary Tree Level Order Traversal 41.3%

2

Medium
104 Maximum Depth of Binary Tree 53.6%

1

Easy
107 Binary Tree Level Order Traversal II 41.3%

1

Easy
108 Convert Sorted Array to Binary Search Tree 43.1%

1

Easy
112 Path Sum 34.5%

1

Easy
118 Pascal’s Triangle 39.4%

1

Easy
119 Pascal’s Triangle II 37.6%

1

Easy
121 Best Time to Buy and Sell Stock 42.3%

1

Easy
122 Best Time to Buy and Sell Stock II 47.8%

1

Easy
125 Valid Palindrome 26.7%

1

Easy
136 Single Number 55.1%

1

Easy
153 Find Minimum in Rotated Sorted Array 40.5%

2

Medium
154 Find Minimum in Rotated Sorted Array II 37.6%

3

Hard
155 Min Stack 30.1%

1

Easy
167 Two Sum II - Input array is sorted 47.2%

1

Easy
168 Excel Sheet Column Title 26.8%

1

Easy
169 Majority Element 47.4%

1

Easy
171 Excel Sheet Column Number 47.9%

1

Easy
172 Factorial Trailing Zeroes 36.6%

1

Easy
189 Rotate Array 25.1%

1

Easy
190 Reverse Bits 29.5%

1

Easy
191 Number of 1 Bits 40.1%

1

Easy
202 Happy Number 41.2%

1

Easy
204 Count Primes 26.6%

1

Easy
206 Reverse Linked List 46.3%

1

Easy
217 Contains Duplicate 46.5%

1

Easy
226 Invert Binary Tree 52.7%

1

Easy
231 Power of Two 40.5%

1

Easy
237 Delete Node in a Linked List 47.1%

1

Easy
242 Valid Anagram 47.0%

1

Easy
258 Add Digits 51.5%

1

Easy
263 Ugly Number 39.5%

1

Easy
264 Ugly Number II 33.1%

2

Medium
268 Missing Number 44.5%

1

Easy
278 First Bad Version 25.9%

1

Easy
283 Move Zeroes 50.9%

1

Easy
292 Nim Game 55.3%

1

Easy
303 Range Sum Query - Immutable 31.2%

1

Easy
307 Range Sum Query - Mutable 21.7%

2

Medium
326 Power of Three 40.5%

1

Easy
338 Counting Bits 61.9%

2

Medium
342 Power of Four 38.8%

1

Easy
344 Reverse String 59.8%

1

Easy
345 Reverse Vowels of a String 38.8%

1

Easy
349 Intersection of Two Arrays 47.7%

1

Easy
350 Intersection of Two Arrays II 44.8%

1

Easy
367 Valid Perfect Square 38.5%

1

Easy
371 Sum of Two Integers 51.1%

1

Easy
383 Ransom Note 47.6%

1

Easy
387 First Unique Character in a String 47.2%

1

Easy
389 Find the Difference 51.0%

1

Easy
401 Binary Watch 44.9%

1

Easy
404 Sum of Left Leaves 47.4%

1

Easy
405 Convert a Number to Hexadecimal 41.0%

1

Easy
409 Longest Palindrome 45.6%

1

Easy
412 Fizz Buzz 58.3%

1

Easy
413 Arithmetic Slices 54.6%

2

Medium
414 Third Maximum Number 28.0%

1

Easy
415 Add Strings 41.6%

1

Easy
419 Battleships in a Board 62.5%

2

Medium
437 Path Sum III 40.1%

1

Easy
442 Find All Duplicates in an Array 56.6%

2

Medium
447 Number of Boomerangs 45.9%

1

Easy
448 Find All Numbers Disappeared in an Array 51.3%

1

Easy
451 Sort Characters By Frequency 51.4%

2

Medium
453 Minimum Moves to Equal Array Elements 47.9%

1

Easy
455 Assign Cookies 47.2%

1

Easy
459 Repeated Substring Pattern 38.2%

1

Easy
461 Hamming Distance 69.7%

1

Easy
463 Island Perimeter 57.6%

1

Easy
476 Number Complement 61.0%

1

Easy
479 Largest Palindrome Product 24.8%

1

Easy
485 Max Consecutive Ones 54.0%

1

Easy
492 Construct the Rectangle 48.3%

1

Easy
496 Next Greater Element I 56.6%

1

Easy
500 Keyboard Row 59.8%

1

Easy
501 Find Mode in Binary Search Tree 37.8%

1

Easy
504 Base 7 44.1%

1

Easy
506 Relative Ranks 46.7%

1

Easy
513 Find Bottom Left Tree Value 56.1%

2

Medium
520 Detect Capital 52.0%

1

Easy
530 Minimum Absolute Difference in BST 47.2%

1

Easy
541 Reverse String II 43.7%

1

Easy
543 Diameter of Binary Tree 44.9%

1

Easy
557 Reverse Words in a String III 59.8%

1

Easy
561 Array Partition I 66.5%

1

Easy
563 Binary Tree Tilt 47.1%

1

Easy
566 Reshape the Matrix 58.2%

1

Easy
575 Distribute Candies 58.4%

1

Easy
669 Trim a Binary Search Tree 58.4%

1

Easy
671 Second Minimum Node In a Binary Tree 42.0%

1

Easy
分享到 评论