Leetcode 精选百题题解,按照数据结构与算法进行分类,专项练习,一道一道搞定,理解,融会贯通,基本上就无敌了!
数学
数组
- #1 Two Sum
- #3 Longest Substring Without Repeating Characters 🌈🌈🌈
- #26 remove-duplicates-from-sorted-array
- #66 plus-one
- #88 merge-sorted-array
- #189 rotate-array
- #283 move-zeroes
- #11 Container With Most Water
- #70 Climbing Stairs
- #15 3Sum
- #面试题 01.07. Rotate Matrix LCCI
- #334. Increasing Triplet Subsequence
- #347. Top K Frequent Elements 🌈🌈
- #155. Min Stack
- #287. Find the Duplicate Number
子数组前缀和问题
- #560. Subarray Sum Equals K
- #523. Continuous Subarray Sum
- #1371. Find the Longest Substring Containing Vowels in Even Counts 🌈🌈🌈
- #974. Subarray Sums Divisible by K
链表
- #2 Add Two Numbers 🌈🌈🌈
- #21 merge-two-sorted-lists ⭐ ️
- #23. Merge k Sorted Lists 🌈🌈
- #206 reverse-linked-list/
- #24 swap-nodes-in-pairs ⭐ ️
- #141 linked-list-cycle
- #142 linked-list-cycle-ii
- #25 reverse-nodes-in-k-group/ 🌈🌈🌈🌈
- #445. Add Two Numbers II 🌈🌈🌈
- #202. Happy Number ⭐️
- #160. Intersection of Two Linked Lists
哈希表
- #1. Two Sum
- #20. Valid Parentheses
- #49. Group Anagrams
- #242. Valid Anagram
- #149. Max Points on a Line 🌈🌈🌈
二叉树遍历
- #94. Binary Tree Inorder Traversal
- #144. Binary Tree Preorder Traversal
- #429. N-ary Tree Level Order Traversal
- #589. N-ary Tree Preorder Traversal
- #590. N-ary Tree Postorder Traversal
- #572. Subtree of Another Tree
- #116. Populating Next Right Pointers in Each Node
- #109. Convert Sorted List to Binary Search Tree
- #101. Symmetric Tree
递归、回溯
- #22. Generate Parentheses
- #46. Permutations
- #47. Permutations II
- #70. Climbing Stairs
- #77. Combinations
- #98. Validate Binary Search Tree
- #104. Maximum Depth of Binary Tree
- #105. Construct Binary Tree from Preorder and Inorder Traversal
- #111. Minimum Depth of Binary Tree
- #226. Invert Binary Tree
- #236. Lowest Common Ancestor of a Binary Tree
递归、分治
- #17. Letter Combinations of a Phone Number
- #50. Pow(x, n)
- #51. N-Queens
- #78. SubSets
- #169. Majority Element
广度优先搜索 / 深度优先搜索
- #102. Binary Tree Level Order Traversal
- #429. N-ary Tree Level Order Traversal
- #515. Find Largest Value in Each Tree Row
- #200. Number of Islands
- #529. Minesweeper
- #面试题13. 机器人的运动范围
- #542. 01 Matrix
字符转换题
贪心算法
- #860. Lemonade Change
- #122. Best Time to Buy and Sell Stock II
- #455. Assign Cookies
- #874. Walking Robot Simulation
- #55. Jump Game
- #45. Jump Game II
二分查找
- #69. Sqrt(x)
- #367. Valid Perfect Square
- #33. Search in Rotated Sorted Array
- #74. Search a 2D Matrix
- 练习:二分查找找有序数组断点
- #1095. Find in Mountain Array
- #278. First Bad Version
动态规划
- #64. Minimum Path Sum
- #91. Decode Ways
- #221. Maximal Square
- #120. Triangle
- #53. Maximum Subarray
- #152. Maximum Product Subarray
- #322. Coin Change
- #198. House Robber
- #213. House Robber II
- #121. Best Time to Buy and Sell Stock
- #122. Best Time to Buy and Sell Stock II
- #621. Task Scheduler
- #42. Trapping Rain Water
- #72. Edit Distance
- #983. Minimum Cost For Tickets
- #84. Largest Rectangle in Histogram
字典树
并查集、DFS、BFS
- #547. Friend Circles
- #200. Number of Islands
- #130. Surrounded Regions
- #36. Valid Sudoku
- #1162. As Far from Land as Possible
公约数问题
- [#1071. Greatest Common Divisor of Strings]
- #914. X of a Kind in a Deck of Cards
位运算
- #191. Number of 1 Bits
- #231. Power of Two
- #190. Reverse Bits
- #51. N-Queens
- #52. N-QueensII
- #面试题56. 数组中数字出现的次数
- #136. Single Number
- #1371. Find the Longest Substring Containing Vowels in Even Counts 🌈🌈🌈
LRU Cache
- #146. LRU Cache 🌈🌈🌈
排序
- #912. Sort an Array
- #1122. Relative Sort Array
- #242. Valid Anagram
- #1244. Design A Leaderboard
- #56. Merge Intervals
- #493. Reverse Pairs
- #215. Kth Largest Element in an Array
归并排序
字符串算法
- #387. First Unique Character in a String
- #541. Reverse String II
- #151. Reverse Words in a String
- #557. Reverse Words in a String III
- #917. Reverse Only Letters
- #205. Isomorphic Strings
- #680. Valid Palindrome II
- #8. String to Integer (atoi)
- #5. Longest Palindromic Substring
- #522. Longest Uncommon Subsequence II 🌈🌈字节跳动
- #394. Decode String
高级动态规划
图 拓扑排序