Skip to content

Commit a7f41b0

Browse files
committed
Moved each file under a directory naming as id range.
1 parent d5215d8 commit a7f41b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+94
-105
lines changed

README.md

+36-36
Original file line numberDiff line numberDiff line change
@@ -13,59 +13,59 @@ I have planned a learning route for you. You just need to do the problems in the
1313
You can skip the more difficult problems and do them later.
1414

1515
# Brute Force
16-
- [503. Next Greater Element II](solutions/0503-next-greater-element-ii.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
16+
- [503. Next Greater Element II](solutions/1-1000/503-next-greater-element-ii.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
1717

1818
# Dynamic Programming
1919
## Basics
20-
- [509. Fibonacci Number](solutions/0509-fibonacci-number.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
20+
- [509. Fibonacci Number](solutions/1-1000/509-fibonacci-number.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
2121

2222
## House Robber
23-
- [198. House Robber](solutions/0198-house-robber.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
24-
- [213. House Robber II](solutions/0213-house-robber-ii.md) was solved in _Python, JavaScript, Go_.
25-
- [337. House Robber III](solutions/0337-house-robber-iii.md) was solved in _Python, JavaScript, Go_ and **2** solutions.
23+
- [198. House Robber](solutions/1-1000/198-house-robber.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
24+
- [213. House Robber II](solutions/1-1000/213-house-robber-ii.md) was solved in _Python, JavaScript, Go_.
25+
- [337. House Robber III](solutions/1-1000/337-house-robber-iii.md) was solved in _Python, JavaScript, Go_ and **2** solutions.
2626

2727
## Knapsack Problems
2828
### 0/1 Knapsack
29-
- [416. Partition Equal Subset Sum](solutions/0416-partition-equal-subset-sum.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_ and **2** solutions.
30-
- [1049. Last Stone Weight II](solutions/1049-last-stone-weight-ii.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_ and **2** solutions.
31-
- [494. Target Sum](solutions/0494-target-sum.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
32-
- [474. Ones and Zeroes](solutions/0474-ones-and-zeroes.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
29+
- [416. Partition Equal Subset Sum](solutions/1-1000/416-partition-equal-subset-sum.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_ and **2** solutions.
30+
- [1049. Last Stone Weight II](solutions/1001-2000/1049-last-stone-weight-ii.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_ and **2** solutions.
31+
- [494. Target Sum](solutions/1-1000/494-target-sum.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
32+
- [474. Ones and Zeroes](solutions/1-1000/474-ones-and-zeroes.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
3333

3434
### Unbounded Knapsack
35-
- [518. Coin Change II](solutions/0518-coin-change-ii.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
36-
- [377. Combination Sum IV](solutions/0377-combination-sum-iv.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
37-
- [322. Coin Change](solutions/0322-coin-change.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
38-
- [279. Perfect Squares](solutions/0279-perfect-squares.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
39-
- [139. Word Break](solutions/0139-word-break.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
35+
- [518. Coin Change II](solutions/1-1000/518-coin-change-ii.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
36+
- [377. Combination Sum IV](solutions/1-1000/377-combination-sum-iv.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
37+
- [322. Coin Change](solutions/1-1000/322-coin-change.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
38+
- [279. Perfect Squares](solutions/1-1000/279-perfect-squares.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
39+
- [139. Word Break](solutions/1-1000/139-word-break.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
4040

4141
## Stock Maximum Profit Problems
42-
- [121. Best Time to Buy and Sell Stock](solutions/0121-best-time-to-buy-and-sell-stock.md) was solved in _Python, JavaScript, Go_.
43-
- [122. Best Time to Buy and Sell Stock II](solutions/0122-best-time-to-buy-and-sell-stock-ii.md) was solved in _Python, JavaScript, Go_.
44-
- [714. Best Time to Buy and Sell Stock with Transaction Fee](solutions/0714-best-time-to-buy-and-sell-stock-with-transaction-fee.md) was solved in _Python, JavaScript, Go_.
45-
- [123. Best Time to Buy and Sell Stock III](solutions/0123-best-time-to-buy-and-sell-stock-iii.md) was solved in _Python, JavaScript, Go_.
46-
- [188. Best Time to Buy and Sell Stock IV](solutions/0188-best-time-to-buy-and-sell-stock-iv.md) was solved in _Python, JavaScript, Go_.
47-
- [309. Best Time to Buy and Sell Stock with Cooldown](solutions/0309-best-time-to-buy-and-sell-stock-with-cooldown.md) was solved in _Python, JavaScript, Go_.
42+
- [121. Best Time to Buy and Sell Stock](solutions/1-1000/121-best-time-to-buy-and-sell-stock.md) was solved in _Python, JavaScript, Go_.
43+
- [122. Best Time to Buy and Sell Stock II](solutions/1-1000/122-best-time-to-buy-and-sell-stock-ii.md) was solved in _Python, JavaScript, Go_.
44+
- [714. Best Time to Buy and Sell Stock with Transaction Fee](solutions/1-1000/714-best-time-to-buy-and-sell-stock-with-transaction-fee.md) was solved in _Python, JavaScript, Go_.
45+
- [123. Best Time to Buy and Sell Stock III](solutions/1-1000/123-best-time-to-buy-and-sell-stock-iii.md) was solved in _Python, JavaScript, Go_.
46+
- [188. Best Time to Buy and Sell Stock IV](solutions/1-1000/188-best-time-to-buy-and-sell-stock-iv.md) was solved in _Python, JavaScript, Go_.
47+
- [309. Best Time to Buy and Sell Stock with Cooldown](solutions/1-1000/309-best-time-to-buy-and-sell-stock-with-cooldown.md) was solved in _Python, JavaScript, Go_.
4848

4949
## Subsequence Problems
50-
- [674. Longest Continuous Increasing Subsequence](solutions/0674-longest-continuous-increasing-subsequence.md) was solved in _Python, Java, JavaScript, C#_.
51-
- [300. Longest Increasing Subsequence](solutions/0300-longest-increasing-subsequence.md) was solved in _Python, Java, JavaScript, C#_.
52-
- [718. Maximum Length of Repeated Subarray](solutions/0718-maximum-length-of-repeated-subarray.md) was solved in _Python, Java, JavaScript, C#_.
53-
- [1143. Longest Common Subsequence](solutions/1143-longest-common-subsequence.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
54-
- [1035. Uncrossed Lines](solutions/1035-uncrossed-lines.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
55-
- [53. Maximum Subarray](solutions/0053-maximum-subarray.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
56-
- [392. Is Subsequence](solutions/0392-is-subsequence.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
57-
- [583. Delete Operation for Two Strings](solutions/0583-delete-operation-for-two-strings.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
58-
- [72. Edit Distance](solutions/0072-edit-distance.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
50+
- [674. Longest Continuous Increasing Subsequence](solutions/1-1000/674-longest-continuous-increasing-subsequence.md) was solved in _Python, Java, JavaScript, C#_.
51+
- [300. Longest Increasing Subsequence](solutions/1-1000/300-longest-increasing-subsequence.md) was solved in _Python, Java, JavaScript, C#_.
52+
- [718. Maximum Length of Repeated Subarray](solutions/1-1000/718-maximum-length-of-repeated-subarray.md) was solved in _Python, Java, JavaScript, C#_.
53+
- [1143. Longest Common Subsequence](solutions/1001-2000/1143-longest-common-subsequence.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
54+
- [1035. Uncrossed Lines](solutions/1001-2000/1035-uncrossed-lines.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
55+
- [53. Maximum Subarray](solutions/1-1000/53-maximum-subarray.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
56+
- [392. Is Subsequence](solutions/1-1000/392-is-subsequence.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
57+
- [583. Delete Operation for Two Strings](solutions/1-1000/583-delete-operation-for-two-strings.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
58+
- [72. Edit Distance](solutions/1-1000/72-edit-distance.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
5959

6060
# Monotonic Stack
61-
- [739. Daily Temperatures](solutions/0739-daily-temperatures.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
62-
- [496. Next Greater Element I](solutions/0496-next-greater-element-i.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
63-
- [42. Trapping Rain Water](solutions/0042-trapping-rain-water.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_ and **2** solutions.
64-
- [84. Largest Rectangle in Histogram](solutions/0084-largest-rectangle-in-histogram.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
61+
- [739. Daily Temperatures](solutions/1-1000/739-daily-temperatures.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
62+
- [496. Next Greater Element I](solutions/1-1000/496-next-greater-element-i.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
63+
- [42. Trapping Rain Water](solutions/1-1000/42-trapping-rain-water.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_ and **2** solutions.
64+
- [84. Largest Rectangle in Histogram](solutions/1-1000/84-largest-rectangle-in-histogram.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
6565

6666
# Graph Theory
67-
- [797. All Paths From Source to Target](solutions/0797-all-paths-from-source-to-target.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_ and **2** solutions.
68-
- [200. Number of Islands](solutions/0200-number-of-islands.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_ and **3** solutions.
69-
- [695. Max Area of Island](solutions/0695-max-area-of-island.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
67+
- [797. All Paths From Source to Target](solutions/1-1000/797-all-paths-from-source-to-target.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_ and **2** solutions.
68+
- [200. Number of Islands](solutions/1-1000/200-number-of-islands.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_ and **3** solutions.
69+
- [695. Max Area of Island](solutions/1-1000/695-max-area-of-island.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
7070

7171
More LeetCode problems will be added soon...
File renamed without changes.
File renamed without changes.

solutions/0200-number-of-islands-2.md renamed to solutions/1-1000/200-number-of-islands-2.md

+11-13
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ Output: 3
3737
# Thoughts
3838
The island problem can be abstracted into a **graph theory** problem. This is an **undirected graph**:
3939

40-
![](../images/graph_undirected_1.svg)
40+
![](../../images/graph_undirected_1.svg)
4141

4242
And this graph may have multiple **connected components** (islands):
4343

44-
![](../images/graph_undirected_2.png)
44+
![](../../images/graph_undirected_2.png)
4545

4646
Finding the number of islands is to find the number of `connected components`.
4747

@@ -57,29 +57,27 @@ Walk from one node to the adjacent node until all nodes on the island are visite
5757
1. Repeat the above two steps until all the lands have been `visited`.
5858

5959
### Solution 1: 'Depth-First Search' by Recursion
60-
Please click [Depth-First Search by Recursion Solution](0200-number-of-islands.md) for `200. Number of Islands` to view.
60+
Please click [Depth-First Search by Recursion Solution](200-number-of-islands.md) for `200. Number of Islands` to view.
6161

6262
## Solution 2: 'Depth-First Search' by Iteration
63-
![](../images/binary_tree_DFS_1.png)
63+
![](../../images/binary_tree_DFS_1.png)
6464

6565
In solution 1, we have known how to traverse a graph by recursion. Computer language support for recursive calls is implemented through stacks.
6666
For every recursive solution, there is an iterative solution, which means the same problem can be solved using loops.
6767
The benefit of using iteration is better program performance. After all, recursive calls are expensive.
6868

6969
Maintaining a stack by yourself can accomplish the same function as recursive calls.
7070

71-
From this sample code bellow, you can see that starting from a node, through recursive calls, it goes up until it can't go any further, turns right, and continues up. The priority order of directions is `up, right, down, and left`.
72-
```python
73-
adjacent_points = [
74-
(i, j - 1), # left
75-
(i + 1, j), # down
76-
(i, j + 1), # right
77-
(i - 1, j), # up
78-
]
71+
From this sample code bellow, you can see that starting from a node, through recursive calls, it goes up until it can't go any further, turns right, and continues up. The priority order of directions is `up, right, down, left`.
72+
```java
73+
pointStack.push({i, j - 1}); // left
74+
pointStack.push({i + 1, j}); // down
75+
pointStack.push({i, j + 1}); // right
76+
pointStack.push({i - 1, j}); // up
7977
```
8078

8179
## Solution 3: Breadth-First Search
82-
Please click [Breadth-First Search Solution](0200-number-of-islands-3.md) for `200. Number of Islands` to view.
80+
Please click [Breadth-First Search Solution](200-number-of-islands-3.md) for `200. Number of Islands` to view.
8381

8482
## Complexity
8583
* Time: `O(n * m)`.

solutions/0200-number-of-islands-3.md renamed to solutions/1-1000/200-number-of-islands-3.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ Output: 3
3737
# Thoughts
3838
The island problem can be abstracted into a **graph theory** problem. This is an **undirected graph**:
3939

40-
![](../images/graph_undirected_1.svg)
40+
![](../../images/graph_undirected_1.svg)
4141

4242
And this graph may have multiple **connected components** (islands):
4343

44-
![](../images/graph_undirected_2.png)
44+
![](../../images/graph_undirected_2.png)
4545

4646
Finding the number of islands is to find the number of `connected components`.
4747

@@ -57,13 +57,13 @@ Walk from one node to the adjacent node until all nodes on the island are visite
5757
1. Repeat the above two steps until all the lands have been `visited`.
5858

5959
### Solution 1: 'Depth-First Search' by Recursion
60-
Please click [Depth-First Search by Recursion Solution](0200-number-of-islands.md) for `200. Number of Islands` to view.
60+
Please click [Depth-First Search by Recursion Solution](200-number-of-islands.md) for `200. Number of Islands` to view.
6161

6262
## Solution 2: 'Depth-First Search' by Iteration
63-
Please click [Depth-First Search by Iteration Solution](0200-number-of-islands-2.md) for `200. Number of Islands` to view.
63+
Please click [Depth-First Search by Iteration Solution](200-number-of-islands-2.md) for `200. Number of Islands` to view.
6464

6565
## Solution 3: Breadth-First Search
66-
![](../images/binary_tree_BFS_1.gif)
66+
![](../../images/binary_tree_BFS_1.gif)
6767

6868
As shown in the figure above, **breadth-first search** can be thought of as visiting nodes in rounds and rounds.
6969
It emphasizes first-in-first-out, so a **queue** is needed.

solutions/0200-number-of-islands.md renamed to solutions/1-1000/200-number-of-islands.md

+11-13
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ Output: 3
3737
# Thoughts
3838
The island problem can be abstracted into a **graph theory** problem. This is an **undirected graph**:
3939

40-
![](../images/graph_undirected_1.svg)
40+
![](../../images/graph_undirected_1.svg)
4141

4242
And this graph may have multiple **connected components** (islands):
4343

44-
![](../images/graph_undirected_2.png)
44+
![](../../images/graph_undirected_2.png)
4545

4646
Finding the number of islands is to find the number of `connected components`.
4747

@@ -57,23 +57,21 @@ Walk from one node to the adjacent node until all nodes on the island are visite
5757
1. Repeat the above two steps until all the lands have been `visited`.
5858

5959
## Solution 1: 'Depth-First Search' by Recursion
60-
![](../images/binary_tree_DFS_1.png)
60+
![](../../images/binary_tree_DFS_1.png)
6161

62-
From this sample code bellow, you can see that starting from a node, through recursive calls, it goes up until it can't go any further, turns right, and continues up. The priority order of directions is `up, right, down, and left`.
63-
```python
64-
adjacent_points = [
65-
(i - 1, j), # up
66-
(i, j + 1), # right
67-
(i + 1, j), # down
68-
(i, j - 1), # left
69-
]
62+
From this sample code bellow, you can see that starting from a node, through recursive calls, it goes up until it can't go any further, turns right, and continues up. The priority order of directions is `up, right, down, left`.
63+
```java
64+
depth_first_search(i - 1, j); // up
65+
depth_first_search(i, j + 1); // right
66+
depth_first_search(i + 1, j); // down
67+
depth_first_search(i, j - 1); // left
7068
```
7169

7270
## Solution 2: 'Depth-First Search' by Iteration
73-
Please click [Depth-First Search by Iteration Solution](0200-number-of-islands-2.md) for `200. Number of Islands` to view.
71+
Please click [Depth-First Search by Iteration Solution](200-number-of-islands-2.md) for `200. Number of Islands` to view.
7472

7573
## Solution 3: Breadth-First Search
76-
Please click [Breadth-First Search Solution](0200-number-of-islands-3.md) for `200. Number of Islands` to view.
74+
Please click [Breadth-First Search Solution](200-number-of-islands-3.md) for `200. Number of Islands` to view.
7775

7876
## Complexity
7977
* Time: `O(n * m)`.
File renamed without changes.

solutions/0042-trapping-rain-water-2.md renamed to solutions/1-1000/42-trapping-rain-water-2.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LeetCode problem link: [42. Trapping Rain Water](https://leetcode.com/problems/t
55
Given `n` non-negative integers representing an elevation map where the width of each bar is `1`, compute how much water it can trap after raining.
66

77
### Example 1
8-
![](../images/examples/0042_1.png)
8+
![](../../images/examples/0042_1.png)
99
```
1010
Input: height = [0,1,0,2,1,0,1,3,2,1,2,1]
1111
Output: 6
@@ -33,10 +33,10 @@ This solution will follow **Monotonic Stack**'s common rule: **only calculating
3333

3434
This common rule can be applied to calculating result for **most** of the **Monotonic Stack** problems.
3535

36-
![](../images/0042.png)
36+
![](../../images/0042.png)
3737

3838
### Solution 1
39-
Please click [42. Trapping Rain Water (solution 1)](./0042-trapping-rain-water.md) to see it.
39+
Please click [42. Trapping Rain Water (solution 1)](42-trapping-rain-water.md) to see it.
4040

4141
### Complexity
4242
* Time: `O(n)`.
@@ -97,7 +97,7 @@ class Solution:
9797
return result
9898
```
9999

100-
![](../images/0042.png)
100+
![](../../images/0042.png)
101101

102102
## C++
103103
```cpp
@@ -161,7 +161,7 @@ var trap = function (heights) {
161161
};
162162
```
163163

164-
![](../images/0042.png)
164+
![](../../images/0042.png)
165165

166166
## C#
167167
```c#
@@ -228,7 +228,7 @@ func trap(heights []int) int {
228228
}
229229
```
230230

231-
![](../images/0042.png)
231+
![](../../images/0042.png)
232232

233233
## Ruby
234234
```ruby

solutions/0042-trapping-rain-water.md renamed to solutions/1-1000/42-trapping-rain-water.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LeetCode problem link: [42. Trapping Rain Water](https://leetcode.com/problems/t
55
Given `n` non-negative integers representing an elevation map where the width of each bar is `1`, compute how much water it can trap after raining.
66

77
### Example 1
8-
![](../images/examples/0042_1.png)
8+
![](../../images/examples/0042_1.png)
99
```
1010
Input: height = [0,1,0,2,1,0,1,3,2,1,2,1]
1111
Output: 6
@@ -36,14 +36,14 @@ This problem can be solved using **Monotonic Stack**.
3636
1) The right side (current item) is **no shorter** than the left side (the top of stack).
3737
2) The right side (current item) is **shorter** than the left side (the top of stack).
3838

39-
![](../images/0042.png)
39+
![](../../images/0042.png)
4040

4141
Detailed solutions will be given later, and now only the best practices in 7 languages are given.
4242

4343
### Solution 2
4444
The `solution 2` will follow **Monotonic Stack**'s common rule: **only calculating when `pop()` is happening**.
4545

46-
Please click [42. Trapping Rain Water (solution 2)](./0042-trapping-rain-water-2.md) to see it.
46+
Please click [42. Trapping Rain Water (solution 2)](42-trapping-rain-water-2.md) to see it.
4747

4848
### Complexity
4949
* Time: `O(n)`.
@@ -108,7 +108,7 @@ class Solution:
108108
return result
109109
```
110110

111-
![](../images/0042.png)
111+
![](../../images/0042.png)
112112

113113
## C++
114114
```cpp
@@ -174,7 +174,7 @@ var trap = function (heights) {
174174
};
175175
```
176176

177-
![](../images/0042.png)
177+
![](../../images/0042.png)
178178

179179
## C#
180180
```c#
@@ -246,7 +246,7 @@ func trap(heights []int) int {
246246
}
247247
```
248248

249-
![](../images/0042.png)
249+
![](../../images/0042.png)
250250

251251
## Ruby
252252
```ruby

solutions/0494-target-sum.md renamed to solutions/1-1000/494-target-sum.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Constraints:
3838
```
3939

4040
* This problem is quite difficult if you have not solved similar problems before. So before you start working on this question,
41-
it is recommended that you first work on another relatively simple question [416. Partition Equal Subset Sum](./0416-partition-equal-subset-sum.md) that is similar to this one.
41+
it is recommended that you first work on another relatively simple question [416. Partition Equal Subset Sum](416-partition-equal-subset-sum.md) that is similar to this one.
4242

4343
## Thoughts
4444
* When we see a set of numbers being used once to obtain another number through some calculation (just like this question), we can consider this to be a `0/1 Knapsack Problem`.

0 commit comments

Comments
 (0)