[leetcode]1. Two Sum兩數之和 |
Two Pointers, HashMap |
Easy |
[leetcode]2. Add Two Numbers兩數相加 |
Math, LinkedList |
Medium |
[leetcode]3. Longest Substring Without Repeating Characters無重複字母的最長子串 |
Sliding Window |
Medium |
[leetcode]4. Median of Two Sorted Arrays倆有序數組的中位數 |
Merge Sort, Binary Search |
Hard |
[leetcode]5. Longest Palindromic Substring最長迴文子串 |
Dynamic Programming, Manacher |
Medium |
[leetcode]6. ZigZag Conversion字符串Z形排列 |
String |
Medium |
[leetcode]7. Reverse Integer反轉整數 |
Math |
Easy |
[leetcode]8. String to Integer (atoi)字符串轉整數 |
Math |
Medium |
[leetcode]9. Palindrome Number 迴文數 |
Math |
Easy |
[leetcode]10. Regular Expression Matching正則表達式的匹配 |
Dynamic Programming |
Hard |
[leetcode]11. Container With Most Water存水最多的容器 |
Two Pointers |
Easy |
[leetcode]12. Integer to Roman整數轉羅馬數字 |
String |
Easy |
[leetcode]13. Roman to Integer羅馬數字轉整數 |
String |
Easy |
[leetcode]14. Longest Common Prefix 最長公共前綴 |
String |
Easy |
[leetcode]15. 3Sum三數之和 |
Two Pointers |
Medium |
[leetcode]16. 3Sum Closest最接近的三數之和 |
Two Pointers |
Medium |
[leetcode]17. Letter Combinations of a Phone Number手機鍵盤的字母組合 |
Backtracking |
Medium |
[leetcode]18. 4Sum四數之和 |
Two Pointers |
Medium |
[leetcode]19. Remove Nth Node From End of List刪除鏈表倒數第N個節點 |
LinkedList |
Easy |
[leetcode]20. Valid Parentheses有效括號序列 |
Stack |
Easy |
[leetcode]21. Merge Two Sorted Lists合併兩個鏈表 |
Merge Sort |
Easy |
[leetcode]22. Generate Parentheses生成括號 |
Backtracking |
Medium |
[leetcode]23. Merge k Sorted Lists歸併k個有序鏈表 |
PriorityQueue |
Medium |
[leetcode]24. Swap Nodes in Pairs交換節點對 |
LinkedList |
Easy |
[leetcode]25. Reverse Nodes in k-Group每k個節點反轉一下 |
LinkedList |
Hard |
[leetcode]26. Remove Duplicates from Sorted Array有序數組去重(單個元素只出現一次) |
Two Pointers |
Easy |
[leetcode]27. Remove Element刪除元素 |
Two Pointers |
Easy |
[leetcode]28. Implement strStr()實現strStr() |
Two Pointers |
Easy |
[leetcode]29. Divide Two Integers兩整數相除 |
Math |
Medium |
[leetcode]30. Substring with Concatenation of All Words由全部單詞連成的子串 |
Sliding Window |
Hard |
[leetcode]31. Next Permutation 下一個排列 |
Array |
Medium |
[leetcode]32. Longest Valid Parentheses最長合法括號子串 |
Stack, Two Pointers |
Medium |
[leetcode]33. Search in Rotated Sorted Array旋轉過有序數組裏找目標值 |
Binary Search |
Medium |
[leetcode]34.Find First and Last Position of Element in Sorted Array找區間 |
Binary Search |
Medium |
[leetcode]35. Search Insert Position尋找插入位置 |
Binary Search |
Easy |
[leetcode]36. Valid Sudoku驗證數獨 |
HashMap |
Medium |
[leetcode]37. Sudoku Solver 解數獨 |
Backtracking |
Hard |
[leetcode]38. Count and Say數數 |
String |
Easy |
[leetcode]39. Combination Sum組合之和 |
Backtracking |
Medium |
[leetcode]40. Combination Sum II組合之和之二 |
Backtracking |
Medium |
[leetcode]41. First Missing Positive第一個未出現的正數 |
Bucket Sort |
Hard |
[leetcode]42. Trapping Rain Water雨水積水問題 |
Two Pointers |
Medium |
[leetcode]43. Multiply Strings高精度乘法 |
Math |
Medium |
[leetcode]44. Wildcard Matching萬能符匹配 |
Dynamic Programming |
Hard |
[leetcode]45. Jump Game II青蛙跳(跳到終點最小步數) |
Greedy |
Hard |
[leetcode]46. Permutations全排列(給定序列無重複元素) |
Backtracking |
Medium |
[leetcode]47. Permutations全排列(給定序列有重複元素) |
Backtracking |
Medium |
[leetcode]48. Rotate Image旋轉圖像 |
Array |
Medium |
[leetcode]49. Group Anagrams變位詞歸類 |
HashMap |
Medium |
[leetcode]50. Pow(x, n)求冪 |
Binary Search |
Medium |
[leetcode]51. N-QueensN皇后 |
Backtracking |
Hard |
[leetcode]52. N-Queens II N皇后 |
Backtracking |
Hard |
[leetcode]53. Maximum Subarray最大子數組和 |
Dynamic Programming |
Easy |
[leetcode]54. Spiral Matrix螺旋矩陣 |
Array |
Medium |
[leetcode]55. Jump Game青蛙跳(可否跳到終點) |
Greedy |
Medium |
[leetcode]56. Merge Intervals歸併區間 |
Sort |
Medium |
[leetcode]57. Insert Interval插入區間 |
Sort |
Hard |
[leetcode]58. Length of Last Word最後一個詞的長度 |
String |
Easy |
[leetcode]59. Spiral Matrix II螺旋遍歷矩陣2 |
Array |
Medium |
[leetcode]60. Permutation Sequence排列序列 |
Math |
Medium |
[leetcode]61. Rotate List旋轉鏈表 |
Linked List |
Medium |
[leetcode]62. Unique Paths 不一樣路徑 |
Dynamic Programming |
Medium |
[leetcode]63. Unique Paths II(有障礙物求路徑和) |
DFS |
Medium |
[leetcode]64. Minimum Path Sum最小路徑和 |
Dynamic Programming |
Medium |
[leetcode]65. Valid Number 有效數值 |
String |
Medium |
[leetcode]66. Plus One加一 |
Array |
Easy |
[leetcode]67. Add Binary 二進制加法 |
String |
Easy |
[leetcode]68. Text Justification文字對齊 |
String |
Hard |
[leetcode]69. Sqrt(x)開方 |
Binary Search |
Medium |
[leetcode]70. Climbing Stairs爬樓梯 |
Dynamic Programming |
Easy |
[leetcode]71. Simplify Path簡化路徑 |
Stack |
Medium |
[leetcode]72. Edit Distance 最少編輯步數 |
Dynamic Programming |
Hard |
[leetcode]73. Set Matrix Zeroes矩陣置0 |
Array |
Medium |
[leetcode]74. Search a 2D Matrix二維矩陣查找 |
Binary Search |
Medium |
[leetcode]75. Sort Colors三色排序 |
Sort |
Medium |
[leetcode]76. Minimum Window Substring最小字符串窗口 |
Sliding Window |
Hard |
[leetcode]77. Combinations組合 |
Backtracking |
Medium |
[leetcode]78. Subsets數組子集 |
Backtracking |
Medium |
[leetcode]79. Word Search找單詞 |
Backtracking |
Medium |
[leetcode]80. Remove Duplicates from Sorted Array II有序數組去重(單個元素可出現兩次) |
Array |
Easy |
[leetcode]81. Search in Rotated Sorted Array II旋轉過有序數組裏找目標值II(有重) |
Array |
Medium |
[leetcode]82. Remove Duplicates from Sorted List II有序鏈表去重(有重刪光) |
Linked List |
Medium |
[leetcode]83. Remove Duplicates from Sorted List有序鏈表去重(有重去重) |
Linked List |
Easy |
[leetcode]84. Largest Rectangle in Histogram直方圖中的最大矩形 |
Stack |
Medium |
[leetcode]85. Maximal Rectangle 最大矩形 |
Stack |
Medium |
[leetcode]86. Partition List劃分鏈表 |
Linked List |
Medium |
[leetcode]87. Scramble String字符串樹形顛倒匹配 |
String |
Medium |
[leetcode]88. Merge Sorted Array歸併有序數組 |
Merge Sort |
Easy |
[leetcode]90. Subsets II數組子集(有重) |
Backtracking |
Medium |
[leetcode]91. Decode Ways解碼方法 |
|
|
[leetcode]92. Reverse Linked List II反轉鏈表2 |
Linked List |
Medium |
[leetcode]93. Restore IP Addresses還原IP地址 |
|
|
[leetcode]94. Binary Tree Inorder Traversal二叉樹中序遍歷 |
DFS |
Easy |
[leetcode]95. Unique Binary Search Trees II給定節點造成不一樣BST的集合 |
Dynamic Programming |
Medium |
[leetcode]96. Unique Binary Search Trees給定節點造成不一樣BST的個數 |
Dynamic Programming |
Medium |
[leetcode]97. Interleaving String可否構成交錯字符串 |
Dynamic Programming |
Medium |
[leetcode]98. Validate Binary Search Tree驗證二叉搜索樹 |
DFS |
Medium |
[leetcode]99. Recover Binary Search Tree恢復二叉搜索樹 |
DFS |
Medium |
[leetcode]100. Same Tree相同的樹 |
DFS |
Easy |
[leetcode]101. Symmetric Tree對稱樹 |
DFS |
Easy |
[leetcode]102. Binary Tree Level Order Traversal二叉樹水平遍歷 |
BFS |
Medium |
[leetcode]103. Binary Tree Zigzag Level Order Traversal二叉樹Z形遍歷 |
BFS |
Easy |
[leetcode]104. Maximum Depth of Binary Tree二叉樹最大深度 |
DFS |
Easy |
105 |
|
|
106 |
|
|
107 |
|
|
108 |
|
|
109 |
|
|
110 |
|
|
111 |
|
|
[leetcode]112. Path Sum路徑和(是否有路徑) |
DFS |
Easy |
[leetcode]113. Path Sum II路徑和(返回路徑) |
Backtracking |
Medium |
[leetcode]114. Flatten Binary Tree to Linked List將二叉樹展成一個鏈表 |
DFS |
Medium |
[leetcode]115. Distinct Subsequences 計算不一樣子序列個數 |
DP |
Medium |
116 |
|
|
[leetcode]117. Populating Next Right Pointers in Each NodeII用next填充同層相鄰節點 |
|
|
118 |
|
|
119 |
|
|
120 |
|
|
[leetcode]121. Best Time to Buy and Sell Stock 最佳炒股時機 |
|
|
[leetcode]122. Best Time to Buy and Sell Stock II 最佳炒股時機之二 |
|
|
[leetcode]123. Best Time to Buy and Sell Stock III 最佳炒股時機之三 |
|
|
[leetcode]124. Binary Tree Maximum Path Sum二叉樹最大路徑和 |
|
|
[leetcode]125. Valid Palindrome判斷迴文串 |
Two Pointers |
Easy |
[leetcode]126. Word Ladder II單詞接龍II |
DFS + BFS |
Hard |
[leetcode]127. Word Ladder單詞接龍 |
BFS |
Medium |
[leetcode]128. Longest Consecutive Sequence最長連續序列 |
HashSet |
|
129 |
|
|
130 |
|
|
[leetcode]131. Palindrome Partitioning字符串分割成迴文子串 |
Backtracking |
Medium |
132 |
|
|
[leetcode]133. Clone Graph 克隆圖 |
Graph |
Medium |
[leetcode]134. Gas Station加油站 |
Greedy |
Medium |
135 |
|
|
136 |
|
|
137 |
|
|
[leetcode]138. Copy List with Random Pointer複製帶隨機指針的鏈表 |
Graph |
Medium |
[leetcode]139. Word Break單詞可否拆分 |
DP |
Medium |
140 |
|
|
[leetcode]141. Linked List Cycle判斷鏈表是否循環 |
Two Pointers |
Easy |
[leetcode]142. Linked List Cycle II找出循環鏈表的入口 |
Two Pointers |
Medium |
[leetcode]143. Reorder List重排鏈表 |
Linked List |
Medium |
144 |
|
|
145 |
|
|
[leetcode]146. LRU Cache實現LRU緩存 |
HashMap + Doubly Linked List |
|
147 |
|
|
148 |
|
|
[leetcode]149. Max Points on a Line多點共線 |
HashMap |
Hard |
[leetcode]150. Evaluate Reverse Polish Notation逆波蘭表示法 |
Stack |
Easy |
[leetcode]151. Reverse Words in a String翻轉給定字符串中的單詞 |
String |
Easy |
[leetcode]152. Maximum Product Subarray最大乘積子數組 |
DP |
Medium |
[leetcode]153. Find Minimum in Rotated Sorted Array旋轉過有序數組裏找最小 |
Binary Search |
Medium |
154 |
|
|
[leetcode]155. Min Stack最小棧 |
Stack |
Easy |
[leetcode]156.Binary Tree Upside Down顛倒二叉樹 |
Tree |
Medium |
[leetcode]158. Read N Characters Given Read4 II - Call multiple times 用Read4讀取N個字符2 - 調用屢次 |
|
|
[leetcode]159. Longest Substring with At Most Two Distinct Characters至多包含兩種字符的最長子串 |
|
|
[leetcode]160. Intersection of Two Linked Lists兩鏈表交點 |
Linked List |
|
[leetcode]161. One Edit Distance編輯步數爲一 |
|
|
162 |
|
|
[leetcode]163. Missing Ranges缺失範圍 |
|
|
164 |
|
|
165 |
|
|
166 |
|
|
167 |
|
|
168 |
|
|
169 |
|
|
[leetcode]170. Two Sum III - Data structure design兩數之和III |
|
|
171 |
|
|
172 |
|
|
[leetcode]173. Binary Search Tree Iterator 二叉搜索樹迭代器 |
|
|
[leetcode]174. Dungeon Game地牢遊戲 |
|
|
175 |
|
|
176 |
|
|
177 |
|
|
178 |
|
|
[leetcode]179. Largest Number最大數 |
|
|
180 |
|
|
181 |
|
|
182 |
|
|
183 |
|
|
184 |
|
|
185 |
|
|
186 |
|
|
[leetcode]187. Repeated DNA Sequences重複DNA序列 |
|
|
|
|
|
|
|
|
[leetcode]198. House Robber小偷搶錢 |
|
|
[leetcode]199. Binary Tree Right Side View二叉樹右側視角 |
|
|
[leetcode]200. Number of Islands島嶼個數 |