LeetCode Problems

为方便以后回顾,先列出所有的150道题:

  1. Two Sum
  2. Add Two Numbers
  3. Longest Substring Without Repeating Characters
  4. Median of Two Sorted Arrays
  5. Longest Palindromic Substring
  6. Reverse Integer
  7. Regular Expression Matching
  8. Container With Most Water
  9. 3Sum
  10. Letter Combinations of a Phone Number
  11. Remove Nth Node From End of List
  12. Valid Parentheses
  13. Merge Two Sorted Lists
  14. Generate Parentheses
  15. Merge k Sorted Lists
  16. Reverse Nodes in k-Group
  17. Search in Rotated Sorted Array
  18. Valid Sudoku
  19. Combination Sum
  20. Combination Sum II
  21. Trapping Rain Water
  22. Multiply Strings
  23. Jump Game II
  24. Permutations
  25. Rotate Image
  26. Group Anagrams
  27. Pow(x, n)
  28. N-Queens
  29. Maximum Subarray
  30. Spiral Matrix
  31. Jump Game
  32. Merge Intervals
  33. Insert Interval
  34. Unique Paths
  35. Plus One
  36. Climbing Stairs
  37. Edit Distance
  38. Set Matrix Zeroes
  39. Search a 2D Matrix
  40. Minimum Window Substring
  41. Subsets
  42. Word Search
  43. Largest Rectangle in Histogram
  44. Subsets II
  45. Decode Ways
  46. Interleaving String
  47. Validate Binary Search Tree
  48. Same Tree
  49. Binary Tree Level Order Traversal
  50. Maximum Depth of Binary Tree
  51. Construct Binary Tree from Preorder and Inorder Traversal
  52. Balanced Binary Tree
  53. Distinct Subsequences
  54. Best Time to Buy and Sell Stock
  55. Binary Tree Maximum Path Sum
  56. Valid Palindrome
  57. Word Ladder
  58. Longest Consecutive Sequence
  59. Surrounded Regions
  60. Palindrome Partitioning
  61. Clone Graph
  62. Gas Station
  63. Single Number
  64. Copy List with Random Pointer
  65. Word Break
  66. Linked List Cycle
  67. Reorder List
  68. LRU Cache
  69. Evaluate Reverse Polish Notation
  70. Maximum Product Subarray
  71. Find Minimum in Rotated Sorted Array
  72. Min Stack
  73. Two Sum II - Input Array Is Sorted
  74. Reverse Bits
  75. Number of 1 Bits
  76. House Robber
  77. Binary Tree Right Side View
  78. Number of Islands
  79. Happy Number
  80. Reverse Linked List
  81. Course Schedule
  82. Implement Trie (Prefix Tree)
  83. Course Schedule II
  84. Design Add and Search Words Data Structure
  85. Word Search II
  86. House Robber II
  87. Kth Largest Element in an Array
  88. Contains Duplicate
  89. Invert Binary Tree
  90. Kth Smallest Element in a BST
  91. Lowest Common Ancestor of a Binary Search Tree
  92. Product of Array Except Self
  93. Sliding Window Maximum
  94. Valid Anagram
  95. Meeting Rooms
  96. Meeting Rooms II
  97. Graph Valid Tree
  98. Missing Number
  99. Alien Dictionary
  100. Encode and Decode Strings
  101. Walls and Gates
  102. Find the Duplicate Number
  103. Find Median from Data Stream
  104. Serialize and Deserialize Binary Tree
  105. Longest Increasing Subsequence
  106. Best Time to Buy and Sell Stock with Cooldown
  107. Burst Balloons
  108. Coin Change
  109. Number of Connected Components in an Undirected Graph
  110. Longest Increasing Path in a Matrix
  111. Reconstruct Itinerary
  112. Counting Bits
  113. Top K Frequent Elements
  114. Design Twitter
  115. Sum of Two Integers
  116. Partition Equal Subset Sum
  117. Pacific Atlantic Water Flow
  118. Longest Repeating Character Replacement
  119. Non-overlapping Intervals
  120. Target Sum
  121. Coin Change II
  122. Diameter of Binary Tree
  123. Permutation in String
  124. Subtree of Another Tree
  125. Task Scheduler
  126. Palindromic Substrings
  127. Valid Parenthesis String
  128. Redundant Connection
  129. Max Area of Island
  130. Daily Temperatures
  131. Network Delay Time
  132. Min Cost Climbing Stairs
  133. Partition Labels
  134. Kth Largest Element in a Stream
  135. Binary Search
  136. Swim in Rising Water
  137. Cheapest Flights Within K Stops
  138. Hand of Straights
  139. Car Fleet
  140. Koko Eating Bananas
  141. K Closest Points to Origin
  142. Time Based Key-Value Store
  143. Rotting Oranges
  144. Last Stone Weight
  145. Longest Common Subsequence
  146. Count Good Nodes in Binary Tree
  147. Min Cost to Connect All Points
  148. Minimum Interval to Include Each Query
  149. Merge Triplets to Form Target Triplet
  150. Detect Squares

遇到数目繁多的,先做的事情是分类:

一、数组

1. 双指针/滑动窗口

2. 排序/查找

3. 动态规划

4. 字符串操作

5. 其他

二、链表

1. 快慢指针

2. 链表操作

三、树

1. 二叉树的遍历

2. 二叉搜索树

3. 其他

四、图

五、其他

1. 堆/栈/队列

2. 设计

随机选中

参考链接