Skip to content

ahscuml/LeetCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode刷题

题号是LeetCode原题,题目是自己的解答

Easy

题号 题目 Tags Star Company
1 Two Sum HashMap ⭐ ⭐ ⭐
7 Reverse Integer Integer ⭐ ⭐
14 Longest Common Prefix String
20 Valid Parentheses String、Stack ⭐ ⭐ ⭐
21 Merge Two Sorted Lists LinkedList ⭐ ⭐ ⭐ ⭐
53 Maximum Subarray Array、DP ⭐ ⭐ ⭐
83 Remove Duplicates from Sorted List ListNode ⭐ ⭐ ⭐ ByteDance
88 Merge Sorted Array Array、双指针
100 Same Tree Tree ⭐ ⭐ ⭐
101 Symmetric Tree Tree ⭐ ⭐ ⭐
104 Maximum Depth of Binary Tree Tree ⭐ ⭐ ⭐
105 Construct Binary Tree from Preorder and Inorder Traversal Tree ⭐ ⭐ ⭐
107 Binary Tree Level Order Traversal II Tree ⭐ ⭐
108 Convert Sorted Array to Binary Search Tree BST ⭐ ⭐ ⭐
110 Balanced Binary Tree Tree,DFS ⭐ ⭐ ⭐ ⭐
111 Minimum Depth of Binary Tree Tree、递归 ⭐ ⭐ ⭐
112 Path Sum Tree ⭐ ⭐
115 Min Stack Stack ⭐ ⭐ ⭐
119 Pascal's Triangle II Array ⭐ ⭐
120 Triangle DP ⭐ ⭐ ⭐
121 Best Time to Buy and Sell Stock DP ⭐ ⭐ ⭐
122 Best Time to Buy and Sell Stock II DP
136 Single Number Array、二进制 ⭐ ⭐ ⭐
141 Linked List Cycle LinkedList、双指针 ⭐ ⭐ ⭐
148 Sort List LinkedList、MergeSort ⭐ ⭐ ⭐ ⭐ ByteDance
160 Intersection of Two Linked Lists LinkedList、双指针 ⭐ ⭐ ⭐ ⭐ ByteDance
169 Majority Element Array ⭐ ⭐
198 House Robber Array、DP ⭐ ⭐ ⭐
200 Number of Islands DFS、BFS ⭐ ⭐ ⭐
206 Reverse Linked List ListNode ⭐ ⭐ ⭐ ⭐
207 Course Schedule DFS、BFS ⭐ ⭐ ⭐
217 Contains Duplicate Array、HashTable
226 Invert Binary Tree Tree ⭐ ⭐ ⭐
234 Palindrome Linked List LinkedList、双指针 ⭐ ⭐ ⭐
235 Lowest Common Ancestor of a Binary Search Tree 递归 ⭐ ⭐ ⭐
257 Binary Tree Paths Tree, String ⭐ ⭐ ⭐ ⭐
338 Counting Bits bits ⭐ ⭐ ⭐
401 Binary Watch 递归
437 Path Sum III HashMap,Tree ⭐ ⭐ ⭐
448 Find All Numbers Disappeared in an Array Array ⭐ ⭐ ⭐
461 Hamming Distance bits ⭐ ⭐ ⭐
538 Convert BST to Greater Tree 二叉搜索树 ⭐ ⭐ ⭐
543 Diameter of Binary Tree Tree、递归 ⭐ ⭐ ⭐
572 Subtree of Another Tree Tree ⭐ ⭐ ⭐ ⭐
581 Shortest Unsorted Continuous Subarray Array ⭐ ⭐ ⭐
617 Merge Two Binary Trees Tree ⭐ ⭐ ⭐
628 Maximum Product of Three Numbers Array
637 Average of Levels in Binary Tree Tree ⭐ ⭐
771 Jewels and Stones String

Medium

题号 题目 Tags Star Company
2 Add Two Numbers LinkedList ⭐ ⭐ ⭐
3 Longest Substring Without Repeating Characters 双指针 ⭐ ⭐ ⭐
5 Longest Palindromic Substring String、动态规划 ⭐ ⭐ ⭐
6 ZigZag Conversion String
15 3Sum Array、双指针 ⭐ ⭐ ⭐
17 Letter Combinations of a Phone Number 递归 ⭐ ⭐ ⭐
19 Remove Nth Node From End of List 双指针 ⭐ ⭐ ⭐
21 Merge Two Sorted Lists List,递归 ⭐ ⭐ ⭐ ⭐
22 Generate Parentheses String、回溯法 ⭐ ⭐ ⭐
24 Swap Nodes in Pairs LinkedList ⭐ ⭐ ⭐
34 Find First and Last Position of Element in Sorted Array Array、BinarySearch ⭐ ⭐ ⭐
39 CombinationSum Array、回溯法 ⭐ ⭐ ⭐
40 CombinationSum Array、回溯法 ⭐ ⭐ ⭐
46 Permutations 回溯法 ⭐ ⭐ ⭐
47 PermutationsII 回溯法 ⭐ ⭐ ⭐
48 Rotate Image 二维数组 ⭐ ⭐
49 Group Anagrams ArrayList, HashMap ⭐ ⭐ ⭐
54 Spiral Matrix 细节问题 ⭐ ⭐
56 Merge Intervals 迭代器,自写比较函数 ⭐ ⭐ ⭐
60 Permutation Sequence Array、感觉像是递归
61 Rotate List LinkedList、双指针
62 Unique Paths 二维数组、动态规划 ⭐ ⭐ ⭐
63 Unique Paths II 二维数组、动态规划 ⭐ ⭐ ⭐
64 Minimum Path Sum 二维数组、动态规划 ⭐ ⭐ ⭐ ⭐
74 Search a 2D Matrix 二分查找 ⭐ ⭐
77 Combinations 回溯法 ⭐ ⭐ ⭐
78 Subsets Array、回溯法 ⭐ ⭐ ⭐
79 Word Search 二维数组、递归 ⭐ ⭐ ⭐
80 Remove Duplicates from Sorted Array II Array、双指针
86 Partition List LinkedList、双指针
90 SubsetsII Array、回溯法 ⭐ ⭐ ⭐
92 Reverse Linked List II LinkedList ⭐ ⭐ ⭐
94 Binary Tree Inorder Traversal Tree ⭐ ⭐ ⭐
95 Unique Binary Search Trees II BST ⭐ ⭐ ⭐
96 Unique Binary Search Trees BST ⭐ ⭐ ⭐
98 Validate Binary Search Tree BST ⭐ ⭐ ⭐ ByteDance
102 Binary Tree Level Order Traversal Tree ⭐ ⭐ ⭐
103 Binary Tree Zigzag Level Order Traversal Tree ⭐ ⭐ ⭐ ByteDance
109 Convert Sorted List to Binary Search Tree BST ⭐ ⭐ ⭐ :star
113 Path Sum II Tree ⭐ ⭐
114 Flatten Binary Tree to Linked List Tree、递归 ⭐ ⭐ ⭐ :star ByteDance
120 Triangle DP ⭐ ⭐ ⭐ ⭐
138 Copy List with Random Pointer List ⭐ ⭐ ⭐
139 Word Break DP ⭐ ⭐ ⭐
142 Linked List Cycle II LinkedList、双指针 ⭐ ⭐ ⭐
143 Reorder List LinkedList ⭐ ⭐ ⭐
152 Maximum Product Subarray Array、 DP ⭐ ⭐ ⭐
173 Binary Search Tree Iterator BST ⭐ ⭐ ⭐
199 Binary Tree Right Side View Tree,递归 ⭐ ⭐ ⭐ ⭐ ByteDance
209 Minimum Size Subarray Sum Array、滑动窗口
213 House Robber II 动态规划 ⭐ ⭐
215 Kth Largest Element in an Array Array、快速选择算法 ⭐ ⭐ ⭐ ⭐ ihandy,ByteDance
216 CombinationSumIII Array、回溯法 ⭐ ⭐ ⭐
221 Maximal Square DP ⭐ ⭐ ⭐
230 Kth Smallest Element in a BST BST ⭐ ⭐ ⭐ ⭐
236 Lowest Common Ancestor of a Binary Tree 递归 ⭐ ⭐ ⭐ ⭐ ByteDance
238 Product of Array Except Self Array
240 Search a 2D Matrix II ⭐ ⭐ ⭐
264 Ugly NumberII DP ⭐ ⭐
279 Perfect Squares DP ⭐ ⭐ ⭐
287 Find the Duplicate Number Array、双指针 ⭐ ⭐ ⭐
300 Longest Increasing Subsequence DP、Binary Search ⭐ ⭐ ⭐
309 Best Time to Buy and Sell Stock with Cooldown DP、状态机 ⭐ ⭐ ⭐
322 Coin Change DP ⭐ ⭐ ⭐ ⭐
328 Odd Even Linked List ListNode ⭐ ⭐
334 Increasing Triplet Subsequence ⭐ ⭐
337 House Robber III HashMap、DP ⭐ ⭐ ⭐
343 Integer Break DP ⭐ ⭐
347 Top K Frequent Elements HashMap ⭐ ⭐ ⭐ ⭐
357 Count Numbers with Unique Digits DP、回溯 ⭐ ⭐ ⭐
416 Partition Equal Subset Sum DP ⭐ ⭐ ⭐ ⭐
438 Find All Anagrams in a String HashTable、滑动窗口 ⭐ ⭐ ⭐
442 Find All Duplicates in an Array Array ⭐ ⭐ ⭐
526 BeautifulArrangement 回溯 ⭐ ⭐ ⭐
560 Subarray Sum Equals K Array、HashMap ⭐ ⭐ ⭐
646 Maximum Length of Pair Chain DP、Greedy ⭐ ⭐ ⭐
673 Number of Longest Increasing Subsequence DP ⭐ ⭐
713 Subarray Product Less Than K 双指针、滑动窗口 ⭐ ⭐
714 Best Time to Buy and Sell Stock with Transaction Fee 动态规划、状态机 ⭐ ⭐ ⭐
718 Maximum Length of Repeated Subarray DP ⭐ ⭐ ⭐
946 Validate Stack Sequences Stack ⭐ ⭐

Hard

题号 题目 Tags Star Company
4 Median of Two Sorted Arrays 分治思想、二分查找 ⭐ ⭐ ⭐
10 Regular Expression Matching DP ⭐ ⭐ ⭐
23 Merge k Sorted Lists ListNode,归并排序,优先队列 ⭐ ⭐ ⭐ ⭐
123 Best Time to Buy and Sell Stock III DP、状态机 ⭐ ⭐ ⭐
124 Binary Tree Maximum Path Sum Tree,递归 ⭐ ⭐ ⭐
146 LRU Cache LRU,HashMap,LinkedHashMap ⭐ ⭐ ⭐ ByteDance
188 Best Time to Buy and Sell Stock IV DP ⭐ ⭐ ⭐
297 Serialize and Deserialize Binary Tree Tree ⭐ ⭐ ⭐

About

刷题整理

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages