Skip to content

Commit 4d30362

Browse files
committed
add array-leetcode-problem
1 parent bb83c96 commit 4d30362

File tree

2 files changed

+162
-1245
lines changed

2 files changed

+162
-1245
lines changed

README.md

Lines changed: 162 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,43 +13,169 @@
1313
------
1414
## LeetCode题目分类
1515
### 数组类题目
16-
#### K-Sum 类题目
17-
| 序号 | 题目 | 难度 |代码|
18-
| :------| :------ | :------ |:------ |
19-
| 1 | [Two Sum](https://leetcode.com/problems/two-sum/) | easy | python、java、c++|
20-
| 167 |[Two Sum II-Input array is sorted](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/)| easy |python、java、c++|
21-
| 15 |[3Sum](https://leetcode.com/problems/3sum/)|medium|python、java、c++|
22-
|16|[3Sum Closet](https://leetcode.com/problems/3sum-closest/)|medium|python、java、c++|
23-
|259|[3Sum Smaller](https://leetcode.com/problems/3sum-smaller/)|medium|python、java、c++|
24-
|18|[4Sum](https://leetcode.com/problems/4sum/)|medium|python、java、c++|
16+
#### K-SUM类题目
17+
| 序号 | 题目 | 难度 | 代码 |
18+
| ---- | ------------------------------------------------------------ | ------ | ----------------- |
19+
| 1 | [Two Sum ](https://leetcode.com/problems/two-sum) | easy | python、java、c++ |
20+
| 167 | [Two Sum II - Input array is sorted ](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted) | Easy | python、java、c++ |
21+
| 15 | [3Sum ](https://leetcode.com/problems/3sum) | Medium | python、java、c++ |
22+
| 16 | [3Sum Closest ](https://leetcode.com/problems/3sum-closest) | Medium | python、java、c++ |
23+
| 259 | [3Sum Smaller ](https://leetcode.com/problems/3sum-smaller) | Medium | python、java、c++ |
24+
| 18 | [4Sum ](https://leetcode.com/problems/4sum) | Medium | python、java、c++ |
2525

2626

2727
#### 区间问题
28-
序号 | 题目 | 难度 |代码|
29-
| :------| :------ | :------ |:------ |
30-
|56| [Merge Intervals](https://leetcode.com/problems/merge-intervals/)|medium||    
31-
|57| [Insert Interval](https://leetcode.com/problems/insert-interval/) |hard||   
32-
|252| [Meeting Rooms](https://leetcode.com/problems/meeting-rooms/)|easy||
33-
|253| [Meeting Rooms II](https://leetcode.com/problems/meeting-rooms-ii/)|medium||
34-
|352| [Data Stream as Disjoint Intervals](https://leetcode.com/problems/data-stream-as-disjoint-intervals/)|hard||
35-
36-
37-
38-
#### 子数组问题
39-
| 序号 | 题目 | 难度 |代码|
40-
| :------| :------ | :------ |:------ |
41-
|78|[Subsets](https://leetcode.com/problems/subsets/)|medium||
42-
|90|[Subsets II](https://leetcode.com/problems/subsets-ii/)|medium||
43-
|53|[Maximum Subarray](https://leetcode.com/problems/maximum-subarray/)|easy||
44-
|325|[Maximum Size Subarray Sum Equals k](https://leetcode.com/problems/maximum-size-subarray-sum-equals-k/)|medium||
45-
|209|[Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/)|medium||
46-
|238|[Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/)|medium||
47-
|152|[Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/)|medium||
48-
|239|[Sliding Window Maximum](https://leetcode.com/problems/sliding-window-maximum/)|hard||
49-
|295|[Find Median from Data Stream](https://leetcode.com/problems/find-median-from-data-stream/)|hard||
50-
|228|[Summary Ranges](https://leetcode.com/problems/summary-ranges/)|medium||
51-
|163|[Missing Ranges](https://leetcode.com/problems/missing-ranges/)|medium||
52-
53-
54-
### 链表类题目
28+
| 序号 | 题目 | 难度 | 代码 |
29+
| ---- | ------------------------------------------------------------ | ------ | :---------------- |
30+
| 56 | [Merge Intervals ](https://leetcode.com/problems/merge-intervals) | Medium | python、java、c++ |
31+
| 57 | [Insert Interval ](https://leetcode.com/problems/insert-interval) | Hard | python、java、c++ |
32+
| 252 | [Meeting Rooms](https://leetcode.com/problems/meeting-rooms/) | easy | python、java、c++ |
33+
| 253 | [Meeting Rooms II](https://leetcode.com/problems/meeting-rooms-ii/) | medium | python、java、c++ |
34+
| 352 | [Data Stream as Disjoint Intervals](https://leetcode.com/problems/data-stream-as-disjoint-intervals/) | hard | python、java、c++ |
35+
36+
#### 子数组类题目
37+
38+
39+
| 序号 | 题目 | 难度 | 代码 |
40+
| ------------ | ------------------------------------------------------------ | ------ | ----------------- |
41+
| 78 | [Subsets](https://leetcode.com/problems/subsets/) | medium | python、java、c++ |
42+
| 90 | [Subsets II](https://leetcode.com/problems/subsets-ii/) | medium | python、java、c++ |
43+
| 53 | [Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) | easy | python、java、c++ |
44+
| 152 | [Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/) | medium | python、java、c++ |
45+
| 239 | [Sliding Window Maximum](https://leetcode.com/problems/sliding-window-maximum/) | hard | python、java、c++ |
46+
| 295 | [Find Median from Data Stream](https://leetcode.com/problems/find-median-from-data-stream/) | hard | python、java、c++ |
47+
| 228 | [Summary Ranges](https://leetcode.com/problems/summary-ranges/) | medium | python、java、c++ |
48+
| 163 | [Missing Ranges](https://leetcode.com/problems/missing-ranges/) | medium | python、java、c++ |
49+
| 325 | [Maximum Size Subarray Sum Equals k](https://leetcode.com/problems/maximum-size-subarray-sum-equals-k/) | medium | python、java、c++ |
50+
| 209 | [Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/) | medium | python、java、c++ |
51+
| 238 | [Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/) | medium | python、java、c++ |
52+
| 128 | [Longest Consecutive Sequence ](https://leetcode.com/problems/longest-consecutive-sequence) | Hard | python、java、c++ |
53+
54+
#### Rotate类题目
55+
| 序号 | 题目 | 难度 | 代码 |
56+
| ------------ | ------------------------------------------------------------ | ------ | ----------------- |
57+
| 48 | [Rotate Image ](https://leetcode.com/problems/rotate-image) | Medium | python、java、c++ |
58+
| 89 | [Search in Rotated Sorted Array ](https://leetcode.com/problems/search-in-rotated-sorted-array) | Medium | python、java、c++ |
59+
| 189 | [Rotate Array ](https://leetcode.com/problems/rotate-array) | Easy | python、java、c++ |
60+
| 81 | [Search in Rotated Sorted Array II ](https://leetcode.com/problems/search-in-rotated-sorted-array-ii) | Medium | python、java、c++ |
61+
62+
#### 数组排序
63+
| 序号 | 题目 | 难度 | 代码 |
64+
| ------------ | ------------------------------------------------------------ | ------ | ----------------- |
65+
| 88 | [Merge Sorted Array ](https://leetcode.com/problems/merge-sorted-array) | Easy | python、java、c++ |
66+
| 75 | [Sort Colors ](https://leetcode.com/problems/sort-colors) | Medium | python、java、c++ |
67+
| 283 | [Move Zeroes ](https://leetcode.com/problems/move-zeroes) | Easy | python、java、c++ |
68+
| 376 | [Wiggle Subsequence](https://leetcode.com/problems/wiggle-subsequence/) | medium | python、java、c++ |
69+
| 280 | [Wiggle Sort](https://leetcode.com/problems/wiggle-sort/) | medium | python、java、c++ |
70+
| 324 | [Wiggle Sort II](https://leetcode.com/problems/wiggle-sort-ii/) | medium | python、java、c++ |
71+
| 215 | [Kth Largest Element in an Array ](https://leetcode.com/problems/kth-largest-element-in-an-array) | medium | python、java、c++ |
72+
| 287 | [Find the Duplicate Number](https://leetcode.com/problems/find-the-duplicate-number) | medium | python、java、c++ |
73+
| 334 | [Increasing Triplet Subsequence ](https://leetcode.com/problems/increasing-triplet-subsequence) | medium | python、java、c++ |
74+
| 400 | [Nth Digit ](https://leetcode.com/problems/nth-digit) | easy | python、java、c++ |
75+
| 387 | [First Unique Character in a String ](https://leetcode.com/problems/first-unique-character-in-a-string) | easy | python、java、c++ |
76+
| 164 | [Maximum Gap ](https://leetcode.com/problems/maximum-gap) | hard | python、java、c++ |
77+
| 347 | [Top K Frequent Elements ](https://leetcode.com/problems/top-k-frequent-elements) | medium | python、java、c++ |
78+
| 243 | [Shortest Word Distance](https://leetcode.com/problems/shortest-word-distance) | easy | python、java、c++ |
79+
| 244 | [Shortest Word Distance II ](https://leetcode.com/problems/shortest-word-distance-ii) | medium | python、java、c++ |
80+
| 245 | [Shortest Word Distance III](https://leetcode.com/problems/shortest-word-distance-iii) | medium | python、java、c++ |
81+
82+
#### 双指针问题
83+
| 序号 | 题目 | 难度 | 代码 |
84+
| ------------ | ------------------------------------------------------------ | ------ | ----------------- |
85+
| 11 | [Container With Most Water ](https://leetcode.com/problems/container-with-most-water) | Medium | python、java、c++ |
86+
| 41 | [First Missing Positive ](https://leetcode.com/problems/first-missing-positive) | Hard | python、java、c++ |
87+
| 42 | [Trapping Rain Water ](https://leetcode.com/problems/trapping-rain-water) | Hard | python、java、c++ |
88+
| 84 | [Largest Rectangle in Histogram ](https://leetcode.com/problems/largest-rectangle-in-histogram) | Hard | python、java、c++ |
89+
| 85 | [Maximal Rectangle ](https://leetcode.com/problems/maximal-rectangle) | Hard | python、java、c++ |
90+
| 243 | [Shortest Word Distance ](https://leetcode.com/problems/shortest-word-distance) | Easy | python、java、c++ |
91+
| 244 | [Shortest Word Distance II](https://leetcode.com/problems/shortest-word-distance-ii) | medium | python、java、c++ |
92+
| 245 | [Shortest Word Distance III ](https://leetcode.com/problems/shortest-word-distance-iii) | Medium | python、java、c++ |
93+
94+
#### 二维数组
95+
| 序号 | 题目 | 难度 | 代码 |
96+
| ------------ | ------------------------------------------------------------ | ------ | ----------------- |
97+
| 48 | [Rotate Image ](https://leetcode.com/problems/rotate-image) | Medium | python、java、c++ |
98+
| 54 | [Spiral Matrix ](https://leetcode.com/problems/spiral-matrix) | Medium | python、java、c++ |
99+
| 73 | [Set Matrix Zeroes ](https://leetcode.com/problems/set-matrix-zeroes) | Medium | python、java、c++ |
100+
| 311 | [Sparse Matrix Multiplication ](https://leetcode.com/problems/sparse-matrix-multiplication) | medium | python、java、c++ |
101+
| 36 | [Valid Sudoku ](https://leetcode.com/problems/valid-sudoku) | meidum | python、java、c++ |
102+
| 37 | [Sudoku Solver ](https://leetcode.com/problems/sudoku-solver) | hard | python、java、c++ |
103+
104+
#### 动态规划
105+
| 序号 | 题目 | 难度 | 代码 |
106+
| ------------ | ------------------------------------------------------------ | ------ | ----------------- |
107+
| 62 | [Unique Paths ](https://leetcode.com/problems/unique-paths) | Medium | python、java、c++ |
108+
| 63 | [Unique Paths II ](https://leetcode.com/problems/unique-paths-ii) | Medium | python、java、c++ |
109+
| 64 | [Minimum Path Sum ](https://leetcode.com/problems/minimum-path-sum) | Medium | python、java、c++ |
110+
| 120 | [Triangle ](https://leetcode.com/problems/triangle) | Medium | python、java、c++ |
111+
112+
#### 二叉树
113+
| 序号 | 题目 | 难度 | 代码 |
114+
| ------------ | ------------------------------------------------------------ | ------ | ----------------- |
115+
| 105 | [Construct Binary Tree from Preorder and Inorder Traversal ](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal) | Medium | python、java、c++ |
116+
| 106 | [Construct Binary Tree from Inorder and Postorder Traversal ](https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal) | Medium | python、java、c++ |
117+
118+
119+
#### Math
120+
| 序号 | 题目 | 难度 | 代码 |
121+
| ------------ | ------------------------------------------------------------ | ------ | ----------------- |
122+
| 66 | [Plus One ](https://leetcode.com/problems/plus-one) | Easy | python、java、c++ |
123+
| 118 | [Pascal's Triangle ](https://leetcode.com/problems/pascals-triangle) | Easy | python、java、c++ |
124+
| 119 | [Pascal's Triangle II ](https://leetcode.com/problems/pascals-triangle-ii) | Easy | python、java、c++ |
125+
126+
####基础
127+
##### 基础题目
128+
| 序号 | 题目 | 难度 | 代码 |
129+
| ------------ | ------------------------------------------------------------ | ------ | ----------------- |
130+
| 217 | [Contains Duplicate ](https://leetcode.com/problems/contains-duplicate) | Easy | python、java、c++ |
131+
| 219 | [Contains Duplicate II ](https://leetcode.com/problems/contains-duplicate-ii) | Easy | python、java、c++ |
132+
| 380 | [Insert Delete GetRandom O(1) ](https://leetcode.com/problems/insert-delete-getrandom-o1) | Medium | python、java、c++ |
133+
| 381 | [Insert Delete GetRandom O(1) - Duplicates allowed ](https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed) | Hard | python、java、c++ |
134+
| 31 | [Next Permutation ](https://leetcode.com/problems/next-permutation) | Medium | |
135+
136+
##### Search类题
137+
| 序号 | 题目 | 难度 | 代码 |
138+
| ------------ | ------------------------------------------------------------ | ------ | ----------------- |
139+
| 33 | [Search in Rotated Sorted Array ](https://leetcode.com/problems/wiggle-subsequence/) | Medium | 代码 |
140+
| 81 | [Search in Rotated Sorted Array II ](https://leetcode.com/problems/sort-colors) | Medium | |
141+
| 34 | [Find First and Last Position of Element in Sorted Array ](https://leetcode.com/problems/wiggle-sort/) | Medium | python、java、c++ |
142+
| 35 | [Search Insert Position ](https://leetcode.com/problems/next-permutation) | Easy | python、java、c++ |
143+
| 74 | [Search a 2D Matrix ](https://leetcode.com/problems/combination-sum) | Medium | python、java、c++ |
144+
| 79 | [Word Search ](https://leetcode.com/problems/combination-sum-ii) | Medium | python、java、c++ |
145+
| 153 | [Find Minimum in Rotated Sorted Array ](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array) | Medium | python、java、c++ |
146+
| 154 | [Find Minimum in Rotated Sorted Array II ](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii) | Hard | python、java、c++ |
147+
| 39 | [Combination Sum ](https://leetcode.com/problems/largest-rectangle-in-histogram) | Medium | python、java、c++ |
148+
| 40 | [Combination Sum II ](https://leetcode.com/problems/combination-sum-ii) | Medium | python、java、c++ |
149+
| 216 | [Combination Sum III ](https://leetcode.com/problems/combination-sum-iii) | Medium | python、java、c++ |
150+
| 45 | [Jump Game II ](https://leetcode.com/problems/jump-game-ii) | Hard | python、java、c++ |
151+
| 55 | [Jump Game ](https://leetcode.com/problems/jump-game) | Medium | python、java、c++ |
152+
| 121 | [Best Time to Buy and Sell Stock ](https://leetcode.com/problems/best-time-to-buy-and-sell-stock) | Easy | python、java、c++ |
153+
| 122 | [Best Time to Buy and Sell Stock II ](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii) | Easy | python、java、c++ |
154+
| 123 | [Best Time to Buy and Sell Stock III ](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii) | Hard | python、java、c++ |
155+
| 126 | [Word Ladder II ](https://leetcode.com/problems/word-ladder-ii) | Hard | python、java、c++ |
156+
| 162 | [Find Peak Element ](https://leetcode.com/problems/find-peak-element) | Medium | python、java、c++ |
157+
| 169 | [Majority Element ](https://leetcode.com/problems/majority-element) | Easy | python、java、c++ |
158+
| 229 | [Majority Element II ](https://leetcode.com/problems/majority-element-ii) | Medium | python、java、c++ |
159+
160+
##### Remove类题目
161+
| 序号 | 题目 | 难度 | 代码 |
162+
| ------------ | ------------------------------------------------------------ | ------ | ----------------- |
163+
| 26 | [Remove Duplicates from Sorted Array ](https://leetcode.com/problems/remove-duplicates-from-sorted-array) | Easy | python、java、c++ |
164+
| 27 | [Remove Element ](https://leetcode.com/problems/remove-element) | Easy | python、java、c++ |
165+
| 80 | [Remove Duplicates from Sorted Array II ](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii) | Medium | python、java、c++ |
166+
167+
#### 提高题目
168+
| 序号 | 题目 | 难度 | 代码 |
169+
| ------------ | ------------------------------------------------------------ | ------ | ----------------- |
170+
| 4 | [Median of Two Sorted Arrays ](https://leetcode.com/problems/median-of-two-sorted-arrays) | Hard | python、java、c++ |
171+
| 289 | [Game of Life ](https://leetcode.com/problems/game-of-life) | Medium | python、java、c++ |
172+
173+
#### 综合题
174+
| 序号 | 题目 | 难度 | 代码 |
175+
| ------------ | ------------------------------------------------------------ | ------ | ----------------- |
176+
| 274 | [H-Index](https://leetcode.com/problems/h-index/) | medium | python、java、c++ |
177+
| 376 | [Wiggle Subsequence](https://leetcode.com/problems/wiggle-subsequence) | medium | python、java、c++ |
178+
| 277 | [Find the Celebrity ](https://leetcode.com/problems/game-of-life) | medium | python、java、c++ |
179+
| 370 | [Range Addition ](https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed) | medium | python、java、c++ |
180+
| 296 | [Best Meeting Point](https://leetcode.com/problems/best-meeting-point) | hard | python、java、c++ |
55181

0 commit comments

Comments
 (0)