-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f58ff3c
commit bce4c7a
Showing
7 changed files
with
51 additions
and
26 deletions.
There are no files selected for viewing
18 changes: 0 additions & 18 deletions
18
LeetCode/src/LeetCode.Challenges/CoinChangeII/Description.md
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...nges/CoinChangeII/BacktrackingSolution.cs → ...0518_CoinChangeII/BacktrackingSolution.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
LeetCode/src/LeetCode.Challenges/Problems05xx/N_0518_CoinChangeII/Description.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Coin Change II (#518) | ||
|
||
You are given an integer array coins representing coins of different denominations | ||
and an integer amount representing a total amount of money. | ||
|
||
Return the number of combinations that make up that amount. | ||
If that amount of money cannot be made up by any combination of the coins, return 0. | ||
|
||
You may assume that you have an infinite number of each kind of coin. | ||
|
||
The answer is guaranteed to fit into a signed 32-bit integer. | ||
|
||
## Examples | ||
|
||
### Example 0: | ||
|
||
Input: `coins = [1, 2]`, `amount = 5` | ||
Output: `3` | ||
Explanation: | ||
`5 = 1 + 1 + 1 + 1 + 1` | ||
`5 = 1 + 1 + 1 + 2` | ||
`5 = 1 + 2 + 2` | ||
|
||
### Example 1: | ||
|
||
Input: `coins = [1, 2, 5]`, `amount = 5` | ||
Output: `4` | ||
Explanation: | ||
`5 = 1 + 1 + 1 + 1 + 1` | ||
`5 = 1 + 1 + 1 + 2` | ||
`5 = 1 + 2 + 2` | ||
`5 = 5` | ||
|
||
### Example 2: | ||
|
||
Input: `amount = 3`, `coins = [2]` | ||
Output: `0` | ||
Explanation: the amount of 3 cannot be made up just with coins of 2. | ||
|
||
### Example 3: | ||
|
||
Input: `amount = 10`, `coins = [10]` | ||
Output: `1` |
2 changes: 1 addition & 1 deletion
2
...llenges/CoinChangeII/RecursionWithMemo.cs → .../N_0518_CoinChangeII/RecursionWithMemo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...CoinChangeII/BacktrackingSolutionTests.cs → ...CoinChangeII/BacktrackingSolutionTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ts/CoinChangeII/RecursionWithMemoTests.cs → ...18_CoinChangeII/RecursionWithMemoTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...lenges.UnitTests/CoinChangeII/TestData.cs → ...blems05xx/N_0518_CoinChangeII/TestData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters