Skip to content

Commit 8a8c11e

Browse files
committed
Create README - LeetHub
1 parent 40c2a61 commit 8a8c11e

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

0322-coin-change/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<h2><a href="https://leetcode.com/problems/coin-change/">322. Coin Change</a></h2><h3>Medium</h3><hr><div><p>You are given an integer array <code>coins</code> representing coins of different denominations and an integer <code>amount</code> representing a total amount of money.</p>
2+
3+
<p>Return <em>the fewest number of coins that you need to make up that amount</em>. If that amount of money cannot be made up by any combination of the coins, return <code>-1</code>.</p>
4+
5+
<p>You may assume that you have an infinite number of each kind of coin.</p>
6+
7+
<p>&nbsp;</p>
8+
<p><strong class="example">Example 1:</strong></p>
9+
10+
<pre><strong>Input:</strong> coins = [1,2,5], amount = 11
11+
<strong>Output:</strong> 3
12+
<strong>Explanation:</strong> 11 = 5 + 5 + 1
13+
</pre>
14+
15+
<p><strong class="example">Example 2:</strong></p>
16+
17+
<pre><strong>Input:</strong> coins = [2], amount = 3
18+
<strong>Output:</strong> -1
19+
</pre>
20+
21+
<p><strong class="example">Example 3:</strong></p>
22+
23+
<pre><strong>Input:</strong> coins = [1], amount = 0
24+
<strong>Output:</strong> 0
25+
</pre>
26+
27+
<p>&nbsp;</p>
28+
<p><strong>Constraints:</strong></p>
29+
30+
<ul>
31+
<li><code>1 &lt;= coins.length &lt;= 12</code></li>
32+
<li><code>1 &lt;= coins[i] &lt;= 2<sup>31</sup> - 1</code></li>
33+
<li><code>0 &lt;= amount &lt;= 10<sup>4</sup></code></li>
34+
</ul>
35+
</div>

0 commit comments

Comments
 (0)