目錄
- 1. 【博文總目錄>>>】
- 2. LeetCode演算法題典
- 3. 所有程式碼下載【https://github.com/Wang-Jun-Chao/leetcode】
- 4. 目錄
- 5. 第001-020題
- 5.0.1. 【001-Two Sum(求兩個數的和)】
- 5.0.2. 【002-Add Two Numbers (單連結串列表示的兩個數相加)】
- 5.0.3. 【003-Longest Substring Without Repeating Characters(最長非重複子字串)】
- 5.0.4. 【004-Median of Two Sorted Arrays(兩個排序陣列的中位數)】
- 5.0.5. 【005-Longest Palindromic Substring(最長迴文子串)】
- 5.0.6. 【006-ZigZag Conversion(Z字型轉換)】
- 5.0.7. 【007-Reverse Integer(翻轉整數)】
- 5.0.8. 【008-String to Integer (atoi) (字串轉成整數)】
- 5.0.9. 【009-Palindrome Number(迴文數)】
- 5.0.10. 【010-Regular Expresssion Matching(正規表示式匹配)】
- 5.0.11. 【011-ContainerWithMostWater(容納最多的水)】
- 5.0.12. 【012-Integer to Roman(數字轉羅馬字元)】
- 5.0.13. 【013-Roman to Integer (羅馬數字轉成整數)】
- 5.0.14. 【014-Longest Common Prefix(最長公共字首)】
- 5.0.15. 【015-3 Sum(三個數的和)】
- 5.0.16. 【016-3 Sum Closest(最接近的三個數的和)】
- 5.0.17. 【017-Letter Combinations of a Phone Number (電話號碼上的單片語合)】
- 5.0.18. 【018-4Sum(四個數的和)】
- 5.0.19. 【019-Remove Nth Node From End of List(移除單連結串列的倒數第N個節點)】
- 5.0.20. 【020-Valid Parentheses(括號驗證)】
- 5.1. 第021-040題
- 5.1.1. 【021-Merge Two Sorted Lists(合併兩個排好序的單連結串列)】
- 5.1.2. 【022-Generate Parentheses(生成括號)】
- 5.1.3. 【023-Merge k Sorted Lists(合併k個排好的的單連結串列)】
- 5.1.4. 【024-Swap Nodes in Pairs(成對交換單連結串列的結點)】
- 5.1.5. 【025-Reverse Nodes in k-Group(單連結串列中k個結點一組進行反轉)】
- 5.1.6. 【026-Remove Duplicates from Sorted Array(刪除排序陣列中的重複元素)】
- 5.1.7. 【027-Remove Element(刪除陣列中的元素)】
- 5.1.8. 【028-Implement strStr() (實現strStr()函式)】
- 5.1.9. 【029-Divide Two Integers(兩個整數相除)】
- 5.1.10. 【030-Substring with Concatenation of All Words(串聯所有單詞的子串)】
- 5.1.11. []( “”)
- 5.1.12. 【032-Longest Valid Parentheses(最長有效括號)】
- 5.1.13. 【033-Search in Rotated Sorted Array(在旋轉陣列中搜尋)】
- 5.1.14. 【034-Search for a Range(搜尋一個範圍)】
- 5.1.15. 【035-Search Insert Position(搜尋插入位置)】
- 5.1.16. 【036-Valid Sudoku(驗證數獨棋盤)】
- 5.1.17. []( “”)
- 5.1.18. 【038-Count and Say(計數和表述)】
- 5.1.19. []( “”)
- 5.1.20. []( “”)
- 5.2. 第041-060題
- 5.2.1. []( “”)
- 5.2.2. []( “”)
- 5.2.3. []( “”)
- 5.2.4. []( “”)
- 5.2.5. []( “”)
- 5.2.6. 【046-Permutations(求排列)】
- 5.2.7. []( “”)
- 5.2.8. []( “”)
- 5.2.9. []( “”)
- 5.2.10. 【050-Implement pow(x, n)(求x的n次方)】
- 5.2.11. []( “”)
- 5.2.12. []( “”)
- 5.2.13. 【053-Maximum Subarray(最大子陣列和)】
- 5.2.14. 【054-Spiral Matrix(螺旋矩陣)】
- 5.2.15. []( “”)
- 5.2.16. 【056-Merge Intervals(區間合併)】
- 5.2.17. 【057-Insert Interval(插入區間)】
- 5.2.18. 【058-Length of Last Word (最後一個單詞的長度)】
- 5.2.19. 【059-Spiral Matrix II(螺旋矩陣II)】
- 5.2.20. []( “”)
- 5.3. 第061-080題
- 5.3.1. 【061-Rotate List(旋轉單連結串列)】
- 5.3.2. 【062-Unique Paths(唯一路徑)】
- 5.3.3. 【063-Unique Paths II(唯一路徑問題II)】
- 5.3.4. 【064-Minimum Path Sum(最小路徑和)】
- 5.3.5. []( “”)
- 5.3.6. 【066-Plus One(加一)】
- 5.3.7. 【067-Add Binary(二進位制加法)】
- 5.3.8. []( “”)
- 5.3.9. []( “”)
- 5.3.10. 【070-Set Matrix Zeroes(矩陣置零)】
- 5.3.11. []( “”)
- 5.3.12. []( “”)
- 5.3.13. 【073-Climbing Stairs(爬樓梯)】
- 5.3.14. 【074-Search a 2D Matrix(搜尋二維矩陣)】
- 5.3.15. 【075-Sort Colors (顏色排序)】
- 5.3.16. []( “”)
- 5.3.17. 【077-Combinations(組合數)】
- 5.3.18. 【078-Subsets(子集)】
- 5.3.19. 【079-Word Search(單詞搜尋)】
- 5.3.20. []( “”)
- 5.4. 第081-100題
- 5.4.1. []( “”)
- 5.4.2. 【081-Search in Rotated Sorted Array II(搜尋旋轉的排序陣列)】
- 5.4.3. 【082-Remove Duplicates from Sorted List II(排序連結串列中刪除重複元素II)】
- 5.4.4. 【083-Remove Duplicates from Sorted List(排序的單連結串列中刪除重複的結點)】
- 5.4.5. []( “”)
- 5.4.6. []( “”)
- 5.4.7. 【086-Partition List(將單連結串列進行分割槽)】
- 5.4.8. 【088-Merge Sorted Array(合併排序陣列)】
- 5.4.9. 【089-Gray Code(格雷碼)】
- 5.4.10. []( “”)
- 5.4.11. []( “”)
- 5.4.12. 【092-Reverse Linked List II(反轉單連結串列II)】
- 5.4.13. 【094-Binary Tree Inorder Traversal(二叉樹中序遍歷)】
- 5.4.14. []( “”)
- 5.4.15. 【096-Unique Binary Search Trees(唯一二叉搜尋樹)】
- 5.4.16. []( “”)
- 5.4.17. []( “”)
- 5.4.18. 【098-Validate Binary Search Tree(驗證二叉搜尋樹)】
- 5.4.19. []( “”)
- 5.4.20. 【100-Same Tree(兩棵樹是否相同)】
- 6. 第101-120題
- 6.4.1. 【101-Symmetric Tree(對稱樹)】
- 6.4.2. 【102-Binary Tree Level Order Traversal(二叉樹層序遍歷)】
- 6.4.3. 【103-Binary Tree Zigzag Level Order Traversal(二叉樹分層Z字形遍歷)】
- 6.4.4. 【104-Maximum Depth of Binary Tree(二叉樹的最大深度)】
- 6.4.5. 【105-Construct Binary Tree from Preorder and Inorder Traversal(通過前序和中序遍歷構造二叉樹)】
- 6.4.6. 【106-Construct Binary Tree from Inorder and Postorder Traversal(通過中序和後序遍歷構造二叉樹)】
- 6.4.7. 【107-Binary Tree Level Order Traversal II(二叉樹層序遍歷II)】
- 6.4.8. 【108-Convert Sorted Array to Binary Search Tree(排序陣列轉變為平衡二叉樹)】
- 6.4.9. 【109-Convert Sorted List to Binary Search Tree(排序連結串列轉換成二叉排序樹)】
- 6.4.10. 【110-Balanced Binary Tree(平衡二叉樹)】
- 6.4.11. 【111-Minimum Depth of Binary Tree(二叉樹的最小深度)】
- 6.4.12. 【112-Path Sum(路徑和)】
- 6.4.13. 【113-Path Sum II(路徑和II)】
- 6.4.14. 【114-Flatten Binary Tree to Linked List(二叉樹轉單連結串列)】
- 6.4.15. []( “”)
- 6.4.16. 【116-Populating Next Right Pointers in Each Node(二叉樹連結右指標)】
- 6.4.17. 【117-Populating Next Right Pointers in Each Node(二叉樹連結右指標II)】
- 6.4.18. 【118-Pascal’s Triangle(帕斯卡三角形(楊輝三角))】
- 6.4.19. 【119-Pascal’s Triangle II(帕斯卡三角形(楊輝三角)II)】
- 6.4.20. 【120-Triangle(三角形)】
- 6.5. 第121-140題
- 6.5.1. 【121-Best Time to Buy and Sell Stock(最佳買賣股票的時間)】
- 6.5.2. []( “”)
- 6.5.3. []( “”)
- 6.5.4. []( “”)
- 6.5.5. 【125-Valid Palindrome(迴文字驗證)】
- 6.5.6. []( “”)
- 6.5.7. []( “”)
- 6.5.8. []( “”)
- 6.5.9. 【129-Sum Root to Leaf Numbers(所有根到葉子結點組組成的數字相加)】
- 6.5.10. 【130-Surrounded Regions(環繞區域)】
- 6.5.11. []( “”)
- 6.5.12. []( “”)
- 6.5.13. []( “”)
- 6.5.14. 【134-Gas Station(加油站問題】
- 6.5.15. []( “”)
- 6.5.16. 【136-Single Number(只出現一次的數字)】
- 6.5.17. 【137-Single Number II(只出現一次的數字II)】
- 6.5.18. 【138-Copy List with Random Pointer(拷貝有隨機指標的單連結串列)】
- 6.5.19. 【139-Word Break(單詞拆分)】
- 6.5.20. []( “”)
- 6.6. 第141-160題
- 6.6.1. 【141-Linked List Cycle(單連結串列中有環)】
- 6.6.2. 【142-Linked List Cycle II(單連結串列中有環II)】
- 6.6.3. 【143-Copy List with Random Pointer(有隨機指標的連結串列複製)】
- 6.6.4. 【144-Binary Tree Preorder Traversal(二叉樹非遞迴前序遍歷)】
- 6.6.5. 【145-Binary Tree Postorder Traversal(二叉樹非遞迴後序遍歷)】
- 6.6.6. []( “”)
- 6.6.7. 【147-Insertion Sort List(連結串列插入排序)】
- 6.6.8. []( “”)
- 6.6.9. []( “”)
- 6.6.10. []( “”)
- 6.6.11. 【150-Evaluate Reverse Polish Notation(計算逆波蘭式)】
- 6.6.12. 【151-Reverse Words in a String(反轉字串中的單詞)】
- 6.6.13. 【152-Maximum Product Subarray(子陣列的最大乘積)】
- 6.6.14. 【153-Find Minimum in Rotated Sorted Array(找旋轉陣列中的最小數字)】
- 6.6.15. 【154-Find Minimum in Rotated Sorted Array II(找旋轉陣列中的最小數字II)】
- 6.6.16. 【155-Min Stack(最小棧)】
- 6.6.17. []( “”)
- 6.6.18. []( “”)
- 6.6.19. []( “”)
- 6.6.20. 【160-Intersection of Two Linked Lists(單連結串列的交集)】
- 7. 第161-180題
- 7.6.1. []( “”)
- 7.6.2. []( “”)
- 7.6.3. []( “”)
- 7.6.4. []( “”)
- 7.6.5. 【165-Compare Version Numbers(比較版本號)】
- 7.6.6. []( “”)
- 7.6.7. []( “”)
- 7.6.8. 【168-Excel Sheet Column Title(Excell列標題)】
- 7.6.9. 【169-Majority Element(主元素)】
- 7.6.10. []( “”)
- 7.6.11. 【171-Excel Sheet Column Number(Excel錶行號)】
- 7.6.12. 【172-Factorial Trailing Zeroes(階乘尾後0的數目)】
- 7.6.13. []( “”)
- 7.6.14. []( “”)
- 7.6.15. []( “”)
- 7.6.16. []( “”)
- 7.6.17. []( “”)
- 7.6.18. []( “”)
- 7.6.19. []( “”)
- 7.6.20. []( “”)
- 7.7. 第181-200題
- 7.7.1. []( “”)
- 7.7.2. []( “”)
- 7.7.3. []( “”)
- 7.7.4. []( “”)
- 7.7.5. []( “”)
- 7.7.6. []( “”)
- 7.7.7. []( “”)
- 7.7.8. []( “”)
- 7.7.9. 【189-Rotate Array(旋轉陣列)】
- 7.7.10. 【190-Reverse Bits(反轉二制)】
- 7.7.11. []( “”)
- 7.7.12. []( “”)
- 7.7.13. []( “”)
- 7.7.14. []( “”)
- 7.7.15. []( “”)
- 7.7.16. []( “”)
- 7.7.17. []( “”)
- 7.7.18. []( “”)
- 7.7.19. 【198-House Robber(搶劫犯)】
- 7.7.20. 【199-Binary Tree Right Side View(從右邊看二叉樹】
- 7.8. 第201-220題
- 7.8.1. 【200-Number of Islands(島的數目)】
- 7.8.2. 【201-Bitwise AND of Numbers Range(範圍數位與結果)】
- 7.8.3. 【202-Happy Number(開心數字)】
- 7.8.4. 【203-Remove Linked List Elements(刪除單連結串列中的元素)】
- 7.8.5. 【204-Count Primes(統計質數)】
- 7.8.6. 【205-Isomorphic Strings(同構字串)】
- 7.8.7. 【206-Reverse Linked List(反轉一個單連結串列)】
- 7.8.8. []( “”)
- 7.8.9. []( “”)
- 7.8.10. []( “”)
- 7.8.11. []( “”)
- 7.8.12. []( “”)
- 7.8.13. []( “”)
- 7.8.14. []( “”)
- 7.8.15. []( “”)
- 7.8.16. 【215-Kth Largest Element in an Array(陣列中第K大的數)】
- 7.8.17. 【216-Combination Sum III (組合數的和)】
- 7.8.18. 【217-Contains Duplicate(包含重複元素)】
- 7.8.19. []( “”)
- 7.8.20. 【219-Contains Duplicate II(包含重複元素II)】
- 7.8.21. []( “”)
- 7.9. 第221-240題
- 7.9.1. []( “”)
- 7.9.2. []( “”)
- 7.9.3. 【223-Rectangle Area(矩形區域)】
- 7.9.4. []( “”)
- 7.9.5. 【225-Implement Stack using Queues(用佇列實現棧操作)】
- 7.9.6. []( “”)
- 7.9.7. []( “”)
- 7.9.8. []( “”)
- 7.9.9. []( “”)
- 7.9.10. []( “”)
- 7.9.11. []( “”)
- 7.9.12. []( “”)
- 7.9.13. []( “”)
- 7.9.14. []( “”)
- 7.9.15. []( “”)
- 7.9.16. []( “”)
- 7.9.17. []( “”)
- 7.9.18. []( “”)
- 7.9.19. []( “”)
- 7.9.20. []( “”)
- 7.10. 第241-260題
- 7.10.1. []( “”)
- 7.10.2. []( “”)
- 7.10.3. []( “”)
- 7.10.4. []( “”)
- 7.10.5. []( “”)
- 7.10.6. []( “”)
- 7.10.7. []( “”)
- 7.10.8. []( “”)
- 7.10.9. []( “”)
- 7.10.10. []( “”)
- 7.10.11. []( “”)
- 7.10.12. []( “”)
- 7.10.13. []( “”)
- 7.10.14. []( “”)
- 7.10.15. []( “”)
- 7.10.16. []( “”)
- 7.10.17. []( “”)
- 7.10.18. []( “”)
- 7.10.19. []( “”)
- 7.10.20. []( “”)
- 7.11. 第261-280題
- 7.11.1. []( “”)
- 7.11.2. []( “”)
- 7.11.3. []( “”)
- 7.11.4. []( “”)
- 7.11.5. []( “”)
- 7.11.6. []( “”)
- 7.11.7. []( “”)
- 7.11.8. []( “”)
- 7.11.9. []( “”)
- 7.11.10. []( “”)
- 7.11.11. []( “”)
- 7.11.12. []( “”)
- 7.11.13. []( “”)
- 7.11.14. []( “”)
- 7.11.15. []( “”)
- 7.11.16. []( “”)
- 7.11.17. []( “”)
- 7.11.18. []( “”)
- 7.11.19. []( “”)
- 7.11.20. []( “”)
- 7.12. 第281-300題
- 7.12.1. []( “”)
- 7.12.2. []( “”)
- 7.12.3. []( “”)
- 7.12.4. []( “”)
- 7.12.5. []( “”)
- 7.12.6. []( “”)
- 7.12.7. []( “”)
- 7.12.8. []( “”)
- 7.12.9. []( “”)
- 7.12.10. []( “”)
- 7.12.11. []( “”)
- 7.12.12. []( “”)
- 7.12.13. []( “”)
- 7.12.14. []( “”)
- 7.12.15. []( “”)
- 7.12.16. []( “”)
- 7.12.17. []( “”)
- 7.12.18. []( “”)
- 7.12.19. []( “”)
- 7.12.20. []( “”)
- 7.13. 第301-320題
- 7.13.1. []( “”)
- 7.13.2. []( “”)
- 7.13.3. []( “”)
- 7.13.4. []( “”)
- 7.13.5. []( “”)
- 7.13.6. []( “”)
- 7.13.7. []( “”)
- 7.13.8. []( “”)
- 7.13.9. []( “”)
- 7.13.10. []( “”)
- 7.13.11. []( “”)
- 7.13.12. []( “”)
- 7.13.13. []( “”)
- 7.13.14. []( “”)
- 7.13.15. []( “”)
- 7.13.16. []( “”)
- 7.13.17. []( “”)
- 7.13.18. []( “”)
- 7.13.19. []( “”)
- 7.13.20. []( “”)
- 7.14. 第321-340題
- 7.14.1. []( “”)
- 7.14.2. []( “”)
- 7.14.3. []( “”)
- 7.14.4. []( “”)
- 7.14.5. []( “”)
- 7.14.6. []( “”)
- 7.14.7. []( “”)
- 7.14.8. []( “”)
- 7.14.9. []( “”)
- 7.14.10. []( “”)
- 7.14.11. []( “”)
- 7.14.12. []( “”)
- 7.14.13. []( “”)
- 7.14.14. []( “”)
- 7.14.15. []( “”)
- 7.14.16. []( “”)
- 7.14.17. []( “”)
- 7.14.18. []( “”)
- 7.14.19. []( “”)
- 7.14.20. []( “”)
- 7.15. 第341-360題
- 7.15.1. []( “”)
- 7.15.2. []( “”)
- 7.15.3. []( “”)
- 7.15.4. []( “”)
- 7.15.5. []( “”)
- 7.15.6. []( “”)
- 7.15.7. []( “”)
- 7.15.8. []( “”)
- 7.15.9. []( “”)
- 7.15.10. []( “”)
- 7.15.11. []( “”)
- 7.15.12. []( “”)
- 7.15.13. []( “”)
- 7.15.14. []( “”)
- 7.15.15. []( “”)
- 7.15.16. []( “”)
- 7.15.17. []( “”)
- 7.15.18. []( “”)
- 7.15.19. []( “”)
- 7.15.20. []( “”)
- 7.16. 第361-380題
- 7.16.1. []( “”)
- 7.16.2. []( “”)
- 7.16.3. []( “”)
- 7.16.4. []( “”)
- 7.16.5. []( “”)
- 7.16.6. []( “”)
- 7.16.7. []( “”)
- 7.16.8. []( “”)
- 7.16.9. []( “”)
- 7.16.10. []( “”)
- 7.16.11. []( “”)
- 7.16.12. []( “”)
- 7.16.13. []( “”)
- 7.16.14. []( “”)
- 7.16.15. []( “”)
- 7.16.16. []( “”)
- 7.16.17. []( “”)
- 7.16.18. []( “”)
- 7.16.19. []( “”)
- 7.16.20. []( “”)
- 7.17. 第381-400題
- 7.17.1. []( “”)
- 7.17.2. []( “”)
- 7.17.3. []( “”)
- 7.17.4. []( “”)
- 7.17.5. []( “”)
- 7.17.6. []( “”)
- 7.17.7. []( “”)
- 7.17.8. []( “”)
- 7.17.9. []( “”)
- 7.17.10. []( “”)
- 7.17.11. []( “”)
- 7.17.12. []( “”)
- 7.17.13. []( “”)
- 7.17.14. []( “”)
- 7.17.15. []( “”)
- 7.17.16. []( “”)
- 7.17.17. []( “”)
- 7.17.18. []( “”)
- 7.17.19. []( “”)
- 7.17.20. []( “”)
- 8. 特別宣告
【博文總目錄>>>】
LeetCode演算法題典
LeetCode是一個準備面試非常有用的網站,是非常值得去的地方,裡面都是一些經典的面試題,這些題目在Google,Microsoft,Facebook,Yahoo等大型網際網路公司面試題中出現過,並且題目分為易,中,難三等,也按專題進行了分類,做題時可以根據自己的喜好進行。本人現在正在LeetCode上進行做題練習,並且將做的過程記錄下來,供自己以後複習和大家學習,這篇部落格就是本人做題的總目錄,本人會持續更新,歡迎大家關注,如果有什麼不足的地方還請大家不吝指出,有什麼好的想法和建議也可以一起討論。
本人的所有部落格都歡迎轉載,轉載請註明出處。
写评论
很抱歉,必須登入網站才能發佈留言。