LeetCode Top 100 Liked 點贊最高的 100 道算法題

做者: 負雪明燭
  node


你們好,相信不少朋友在刷題時,看到 LeetCode 的 2000 多道題目,有點手足無措,很是須要一個刷題的順序和清單。正則表達式

我整理了在 LeetCode(中文版)上點贊數前 100 的題目,這些的題目基本都在千贊以上,所有都是好題。數據庫

舉個例子,1. Two Sum(兩數之和)這個題目有着全站最高的點贊數:11757!!這題也是經典中的經典了,確定要掌握的。
在這裏插入圖片描述express


LeetCode top 100 liked 題目列表

下面的表格根據 Likes 數目對題目進行了排序。數組

題號 英文題名 中文題名 難度 likes 數 標籤 中文力扣地址 英文 LeetCode 地址
1 Two Sum 兩數之和 Easy 11757 數組,哈希表 https://leetcode-cn.com/problems/two-sum/ https://leetcode.com/problems/two-sum/
2 Add Two Numbers 兩數相加 Medium 6524 遞歸,鏈表,數學 https://leetcode-cn.com/problems/add-two-numbers/ https://leetcode.com/problems/add-two-numbers/
3 Longest Substring Without Repeating Characters 無重複字符的最長子串 Medium 5845 哈希表,字符串,滑動窗口 https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/ https://leetcode.com/problems/longest-substring-without-repeating-characters/
4 Median of Two Sorted Arrays 尋找兩個正序數組的中位數 Hard 4303 數組,二分查找,分治 https://leetcode-cn.com/problems/median-of-two-sorted-arrays/ https://leetcode.com/problems/median-of-two-sorted-arrays/
5 Longest Palindromic Substring 最長迴文子串 Medium 3896 字符串,動態規劃 https://leetcode-cn.com/problems/longest-palindromic-substring/ https://leetcode.com/problems/longest-palindromic-substring/
15 3Sum 三數之和 Medium 3582 數組,雙指針,排序 https://leetcode-cn.com/problems/3sum/ https://leetcode.com/problems/3sum/
53 Maximum Subarray 最大子序和 Easy 3533 數組,分治,動態規劃 https://leetcode-cn.com/problems/maximum-subarray/ https://leetcode.com/problems/maximum-subarray/
7 Reverse Integer 整數反轉 Easy 2970 數學 https://leetcode-cn.com/problems/reverse-integer/ https://leetcode.com/problems/reverse-integer/
11 Container With Most Water 盛最多水的容器 Medium 2659 貪心,數組,雙指針 https://leetcode-cn.com/problems/container-with-most-water/ https://leetcode.com/problems/container-with-most-water/
42 Trapping Rain Water 接雨水 Hard 2552 棧,數組,雙指針,動態規劃,單調棧 https://leetcode-cn.com/problems/trapping-rain-water/ https://leetcode.com/problems/trapping-rain-water/
20 Valid Parentheses 有效的括號 Easy 2544 棧,字符串 https://leetcode-cn.com/problems/valid-parentheses/ https://leetcode.com/problems/valid-parentheses/
10 Regular Expression Matching 正則表達式匹配 Hard 2273 遞歸,字符串,動態規劃 https://leetcode-cn.com/problems/regular-expression-matching/ https://leetcode.com/problems/regular-expression-matching/
26 Remove Duplicates from Sorted Array 刪除有序數組中的重複項 Easy 2146 數組,雙指針 https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/ https://leetcode.com/problems/remove-duplicates-from-sorted-array/
136 Single Number 只出現一次的數字 Easy 1958 位運算,數組 https://leetcode-cn.com/problems/single-number/ https://leetcode.com/problems/single-number/
22 Generate Parentheses 括號生成 Medium 1946 字符串,動態規劃,回溯 https://leetcode-cn.com/problems/generate-parentheses/ https://leetcode.com/problems/generate-parentheses/
206 Reverse Linked List 反轉鏈表 Easy 1886 遞歸,鏈表 https://leetcode-cn.com/problems/reverse-linked-list/ https://leetcode.com/problems/reverse-linked-list/
21 Merge Two Sorted Lists 合併兩個有序鏈表 Easy 1832 遞歸,鏈表 https://leetcode-cn.com/problems/merge-two-sorted-lists/ https://leetcode.com/problems/merge-two-sorted-lists/
70 Climbing Stairs 爬樓梯 Easy 1791 記憶化搜索,數學,動態規劃 https://leetcode-cn.com/problems/climbing-stairs/ https://leetcode.com/problems/climbing-stairs/
300 Longest Increasing Subsequence 最長遞增子序列 Medium 1773 數組,二分查找,動態規劃 https://leetcode-cn.com/problems/longest-increasing-subsequence/ https://leetcode.com/problems/longest-increasing-subsequence/
121 Best Time to Buy and Sell Stock 買賣股票的最佳時機 Easy 1766 數組,動態規劃 https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/ https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
72 Edit Distance 編輯距離 Hard 1743 字符串,動態規劃 https://leetcode-cn.com/problems/edit-distance/ https://leetcode.com/problems/edit-distance/
14 Longest Common Prefix 最長公共前綴 Easy 1707 字符串 https://leetcode-cn.com/problems/longest-common-prefix/ https://leetcode.com/problems/longest-common-prefix/
198 House Robber 打家劫舍 Medium 1585 數組,動態規劃 https://leetcode-cn.com/problems/house-robber/ https://leetcode.com/problems/house-robber/
9 Palindrome Number 迴文數 Easy 1568 數學 https://leetcode-cn.com/problems/palindrome-number/ https://leetcode.com/problems/palindrome-number/
146 LRU Cache LRU 緩存機制 Medium 1544 設計,哈希表,鏈表,雙向鏈表 https://leetcode-cn.com/problems/lru-cache/ https://leetcode.com/problems/lru-cache/
19 Remove Nth Node From End of List 刪除鏈表的倒數第 N 個結點 Medium 1494 鏈表,雙指針 https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/ https://leetcode.com/problems/remove-nth-node-from-end-of-list/
33 Search in Rotated Sorted Array 搜索旋轉排序數組 Medium 1493 數組,二分查找 https://leetcode-cn.com/problems/search-in-rotated-sorted-array/ https://leetcode.com/problems/search-in-rotated-sorted-array/
46 Permutations 全排列 Medium 1484 數組,回溯 https://leetcode-cn.com/problems/permutations/ https://leetcode.com/problems/permutations/
101 Symmetric Tree 對稱二叉樹 Easy 1483 樹,深度優先搜索,廣度優先搜索,二叉樹 https://leetcode-cn.com/problems/symmetric-tree/ https://leetcode.com/problems/symmetric-tree/
84 Largest Rectangle in Histogram 柱狀圖中最大的矩形 Hard 1472 棧,數組,單調棧 https://leetcode-cn.com/problems/largest-rectangle-in-histogram/ https://leetcode.com/problems/largest-rectangle-in-histogram/
39 Combination Sum 組合總和 Medium 1466 數組,回溯 https://leetcode-cn.com/problems/combination-sum/ https://leetcode.com/problems/combination-sum/
13 Roman to Integer 羅馬數字轉整數 Easy 1436 哈希表,數學,字符串 https://leetcode-cn.com/problems/roman-to-integer/ https://leetcode.com/problems/roman-to-integer/
23 Merge k Sorted Lists 合併K個升序鏈表 Hard 1436 鏈表,分治,堆(優先隊列),歸併排序 https://leetcode-cn.com/problems/merge-k-sorted-lists/ https://leetcode.com/problems/merge-k-sorted-lists/
17 Letter Combinations of a Phone Number 電話號碼的字母組合 Medium 1436 哈希表,字符串,回溯 https://leetcode-cn.com/problems/letter-combinations-of-a-phone-number/ https://leetcode.com/problems/letter-combinations-of-a-phone-number/
322 Coin Change 零錢兌換 Medium 1414 廣度優先搜索,數組,動態規劃 https://leetcode-cn.com/problems/coin-change/ https://leetcode.com/problems/coin-change/
32 Longest Valid Parentheses 最長有效括號 Hard 1400 棧,字符串,動態規劃 https://leetcode-cn.com/problems/longest-valid-parentheses/ https://leetcode.com/problems/longest-valid-parentheses/
287 Find the Duplicate Number 尋找重複數 Medium 1325 位運算,數組,雙指針,二分查找 https://leetcode-cn.com/problems/find-the-duplicate-number/ https://leetcode.com/problems/find-the-duplicate-number/
122 Best Time to Buy and Sell Stock II 買賣股票的最佳時機 II Easy 1306 貪心,數組,動態規劃 https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii/ https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/
160 Intersection of Two Linked Lists 相交鏈表 Easy 1302 哈希表,鏈表,雙指針 https://leetcode-cn.com/problems/intersection-of-two-linked-lists/ https://leetcode.com/problems/intersection-of-two-linked-lists/
55 Jump Game 跳躍遊戲 Medium 1292 貪心,數組,動態規劃 https://leetcode-cn.com/problems/jump-game/ https://leetcode.com/problems/jump-game/
76 Minimum Window Substring 最小覆蓋子串 Hard 1280 哈希表,字符串,滑動窗口 https://leetcode-cn.com/problems/minimum-window-substring/ https://leetcode.com/problems/minimum-window-substring/
200 Number of Islands 島嶼數量 Medium 1270 深度優先搜索,廣度優先搜索,並查集,數組,矩陣 https://leetcode-cn.com/problems/number-of-islands/ https://leetcode.com/problems/number-of-islands/
78 Subsets 子集 Medium 1269 位運算,數組,回溯 https://leetcode-cn.com/problems/subsets/ https://leetcode.com/problems/subsets/
31 Next Permutation 下一個排列 Medium 1260 數組,雙指針 https://leetcode-cn.com/problems/next-permutation/ https://leetcode.com/problems/next-permutation/
96 Unique Binary Search Trees 不一樣的二叉搜索樹 Medium 1257 樹,二叉搜索樹,數學,動態規劃,二叉樹 https://leetcode-cn.com/problems/unique-binary-search-trees/ https://leetcode.com/problems/unique-binary-search-trees/
148 Sort List 排序鏈表 Medium 1248 鏈表,雙指針,分治,排序,歸併排序 https://leetcode-cn.com/problems/sort-list/ https://leetcode.com/problems/sort-list/
236 Lowest Common Ancestor of a Binary Tree 二叉樹的最近公共祖先 Medium 1238 樹,深度優先搜索,二叉樹 https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-tree/ https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/
25 Reverse Nodes in k-Group K 個一組翻轉鏈表 Hard 1230 遞歸,鏈表 https://leetcode-cn.com/problems/reverse-nodes-in-k-group/ https://leetcode.com/problems/reverse-nodes-in-k-group/
6 ZigZag Conversion Z 字形變換 Medium 1226 字符串 https://leetcode-cn.com/problems/zigzag-conversion/ https://leetcode.com/problems/zigzag-conversion/
152 Maximum Product Subarray 乘積最大子數組 Medium 1223 數組,動態規劃 https://leetcode-cn.com/problems/maximum-product-subarray/ https://leetcode.com/problems/maximum-product-subarray/
215 Kth Largest Element in an Array 數組中的第K個最大元素 Medium 1211 數組,分治,快速選擇,排序,堆(優先隊列) https://leetcode-cn.com/problems/kth-largest-element-in-an-array/ https://leetcode.com/problems/kth-largest-element-in-an-array/
8 String to Integer (atoi) 字符串轉換整數 (atoi) Medium 1168 字符串 https://leetcode-cn.com/problems/string-to-integer-atoi/ https://leetcode.com/problems/string-to-integer-atoi/
41 First Missing Positive 缺失的第一個正數 Hard 1163 數組,哈希表 https://leetcode-cn.com/problems/first-missing-positive/ https://leetcode.com/problems/first-missing-positive/
283 Move Zeroes 移動零 Easy 1162 數組,雙指針 https://leetcode-cn.com/problems/move-zeroes/ https://leetcode.com/problems/move-zeroes/
141 Linked List Cycle 環形鏈表 Easy 1161 哈希表,鏈表,雙指針 https://leetcode-cn.com/problems/linked-list-cycle/ https://leetcode.com/problems/linked-list-cycle/
98 Validate Binary Search Tree 驗證二叉搜索樹 Medium 1156 樹,深度優先搜索,二叉搜索樹,二叉樹 https://leetcode-cn.com/problems/validate-binary-search-tree/ https://leetcode.com/problems/validate-binary-search-tree/
124 Binary Tree Maximum Path Sum 二叉樹中的最大路徑和 Hard 1152 樹,深度優先搜索,動態規劃,二叉樹 https://leetcode-cn.com/problems/binary-tree-maximum-path-sum/ https://leetcode.com/problems/binary-tree-maximum-path-sum/
105 Construct Binary Tree from Preorder and Inorder Traversal 從前序與中序遍歷序列構造二叉樹 Medium 1149 樹,數組,哈希表,分治,二叉樹 https://leetcode-cn.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
34 Find First and Last Position of Element in Sorted Array 在排序數組中查找元素的第一個和最後一個位置 Medium 1137 數組,二分查找 https://leetcode-cn.com/problems/find-first-and-last-position-of-element-in-sorted-array/ https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/
239 Sliding Window Maximum 滑動窗口最大值 Hard 1114 隊列,數組,滑動窗口,單調隊列,堆(優先隊列) https://leetcode-cn.com/problems/sliding-window-maximum/ https://leetcode.com/problems/sliding-window-maximum/
142 Linked List Cycle II 環形鏈表 II Medium 1097 哈希表,鏈表,雙指針 https://leetcode-cn.com/problems/linked-list-cycle-ii/ https://leetcode.com/problems/linked-list-cycle-ii/
139 Word Break 單詞拆分 Medium 1097 字典樹,記憶化搜索,哈希表,字符串,動態規劃 https://leetcode-cn.com/problems/word-break/ https://leetcode.com/problems/word-break/
45 Jump Game II 跳躍遊戲 II Medium 1094 貪心,數組,動態規劃 https://leetcode-cn.com/problems/jump-game-ii/ https://leetcode.com/problems/jump-game-ii/
169 Majority Element 多數元素 Easy 1089 數組,哈希表,分治,計數,排序 https://leetcode-cn.com/problems/majority-element/ https://leetcode.com/problems/majority-element/
234 Palindrome Linked List 迴文鏈表 Easy 1072 棧,遞歸,鏈表,雙指針 https://leetcode-cn.com/problems/palindrome-linked-list/ https://leetcode.com/problems/palindrome-linked-list/
62 Unique Paths 不一樣路徑 Medium 1072 數學,動態規劃,組合數學 https://leetcode-cn.com/problems/unique-paths/ https://leetcode.com/problems/unique-paths/
189 Rotate Array 旋轉數組 Medium 1057 數組,數學,雙指針 https://leetcode-cn.com/problems/rotate-array/ https://leetcode.com/problems/rotate-array/
94 Binary Tree Inorder Traversal 二叉樹的中序遍歷 Easy 1052 棧,樹,深度優先搜索,二叉樹 https://leetcode-cn.com/problems/binary-tree-inorder-traversal/ https://leetcode.com/problems/binary-tree-inorder-traversal/
56 Merge Intervals 合併區間 Medium 1051 數組,排序 https://leetcode-cn.com/problems/merge-intervals/ https://leetcode.com/problems/merge-intervals/
88 Merge Sorted Array 合併兩個有序數組 Easy 1041 數組,雙指針,排序 https://leetcode-cn.com/problems/merge-sorted-array/ https://leetcode.com/problems/merge-sorted-array/
560 Subarray Sum Equals K 和爲K的子數組 Medium 1036 數組,哈希表,前綴和 https://leetcode-cn.com/problems/subarray-sum-equals-k/ https://leetcode.com/problems/subarray-sum-equals-k/
279 Perfect Squares 徹底平方數 Medium 1035 廣度優先搜索,數學,動態規劃 https://leetcode-cn.com/problems/perfect-squares/ https://leetcode.com/problems/perfect-squares/
35 Search Insert Position 搜索插入位置 Easy 1005 數組,二分查找 https://leetcode-cn.com/problems/search-insert-position/ https://leetcode.com/problems/search-insert-position/
24 Swap Nodes in Pairs 兩兩交換鏈表中的節點 Medium 996 遞歸,鏈表 https://leetcode-cn.com/problems/swap-nodes-in-pairs/ https://leetcode.com/problems/swap-nodes-in-pairs/
85 Maximal Rectangle 最大矩形 Hard 983 棧,數組,動態規劃,矩陣,單調棧 https://leetcode-cn.com/problems/maximal-rectangle/ https://leetcode.com/problems/maximal-rectangle/
28 Implement strStr() 實現 strStr() Easy 982 雙指針,字符串,字符串匹配 https://leetcode-cn.com/problems/implement-strstr/ https://leetcode.com/problems/implement-strstr/
92 Reverse Linked List II 反轉鏈表 II Medium 980 鏈表 https://leetcode-cn.com/problems/reverse-linked-list-ii/ https://leetcode.com/problems/reverse-linked-list-ii/
155 Min Stack 最小棧 Easy 979 棧,設計 https://leetcode-cn.com/problems/min-stack/ https://leetcode.com/problems/min-stack/
79 Word Search 單詞搜索 Medium 979 數組,回溯,矩陣 https://leetcode-cn.com/problems/word-search/ https://leetcode.com/problems/word-search/
27 Remove Element 移除元素 Easy 967 數組,雙指針 https://leetcode-cn.com/problems/remove-element/ https://leetcode.com/problems/remove-element/
51 N-Queens N 皇后 Hard 965 數組,回溯 https://leetcode-cn.com/problems/n-queens/ https://leetcode.com/problems/n-queens/
75 Sort Colors 顏色分類 Medium 961 數組,雙指針,排序 https://leetcode-cn.com/problems/sort-colors/ https://leetcode.com/problems/sort-colors/
102 Binary Tree Level Order Traversal 二叉樹的層序遍歷 Medium 960 樹,廣度優先搜索,二叉樹 https://leetcode-cn.com/problems/binary-tree-level-order-traversal/ https://leetcode.com/problems/binary-tree-level-order-traversal/
48 Rotate Image 旋轉圖像 Medium 960 數組,數學,矩陣 https://leetcode-cn.com/problems/rotate-image/ https://leetcode.com/problems/rotate-image/
95 Unique Binary Search Trees II 不一樣的二叉搜索樹 II Medium 955 樹,二叉搜索樹,動態規劃,回溯,二叉樹 https://leetcode-cn.com/problems/unique-binary-search-trees-ii/ https://leetcode.com/problems/unique-binary-search-trees-ii/
64 Minimum Path Sum 最小路徑和 Medium 954 數組,動態規劃,矩陣 https://leetcode-cn.com/problems/minimum-path-sum/ https://leetcode.com/problems/minimum-path-sum/
406 Queue Reconstruction by Height 根據身高重建隊列 Medium 947 貪心,數組,排序 https://leetcode-cn.com/problems/queue-reconstruction-by-height/ https://leetcode.com/problems/queue-reconstruction-by-height/
226 Invert Binary Tree 翻轉二叉樹 Easy 941 樹,深度優先搜索,廣度優先搜索,二叉樹 https://leetcode-cn.com/problems/invert-binary-tree/ https://leetcode.com/problems/invert-binary-tree/
437 Path Sum III 路徑總和 III Medium 937 樹,深度優先搜索,二叉樹 https://leetcode-cn.com/problems/path-sum-iii/ https://leetcode.com/problems/path-sum-iii/
104 Maximum Depth of Binary Tree 二叉樹的最大深度 Easy 937 樹,深度優先搜索,廣度優先搜索,二叉樹 https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/ https://leetcode.com/problems/maximum-depth-of-binary-tree/
237 Delete Node in a Linked List 刪除鏈表中的節點 Easy 936 鏈表 https://leetcode-cn.com/problems/delete-node-in-a-linked-list/ https://leetcode.com/problems/delete-node-in-a-linked-list/
337 House Robber III 打家劫舍 III Medium 929 樹,深度優先搜索,動態規劃,二叉樹 https://leetcode-cn.com/problems/house-robber-iii/ https://leetcode.com/problems/house-robber-iii/
18 4Sum 四數之和 Medium 918 數組,雙指針,排序 https://leetcode-cn.com/problems/4sum/ https://leetcode.com/problems/4sum/
91 Decode Ways 解碼方法 Medium 904 字符串,動態規劃 https://leetcode-cn.com/problems/decode-ways/ https://leetcode.com/problems/decode-ways/
207 Course Schedule 課程表 Medium 897 深度優先搜索,廣度優先搜索,圖,拓撲排序 https://leetcode-cn.com/problems/course-schedule/ https://leetcode.com/problems/course-schedule/
37 Sudoku Solver 解數獨 Hard 897 數組,回溯,矩陣 https://leetcode-cn.com/problems/sudoku-solver/ https://leetcode.com/problems/sudoku-solver/
175 Combine Two Tables 組合兩個表 Easy 891 數據庫 https://leetcode-cn.com/problems/combine-two-tables/ https://leetcode.com/problems/combine-two-tables/
416 Partition Equal Subset Sum 分割等和子集 Medium 886 數組,動態規劃 https://leetcode-cn.com/problems/partition-equal-subset-sum/ https://leetcode.com/problems/partition-equal-subset-sum/
238 Product of Array Except Self 除自身之外數組的乘積 Medium 885 數組,前綴和 https://leetcode-cn.com/problems/product-of-array-except-self/ https://leetcode.com/problems/product-of-array-except-self/
114 Flatten Binary Tree to Linked List 二叉樹展開爲鏈表 Medium 877 棧,樹,深度優先搜索,鏈表,二叉樹 https://leetcode-cn.com/problems/flatten-binary-tree-to-linked-list/ https://leetcode.com/problems/flatten-binary-tree-to-linked-list/

2021 年 8 月 8 日於北京緩存

相關文章
相關標籤/搜索