We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3091f15 commit 94ca2dfCopy full SHA for 94ca2df
dynamic_programming/coin_change.cpp
@@ -6,8 +6,7 @@ using namespace std;
6
// Function to find the Minimum number of coins required to get Sum S
7
int findMinCoins(int arr[], int n, int N) {
8
// dp[i] = no of coins required to get a total of i
9
- std::vector<int> dp;
10
- dp.reserve(N + 1);
+ std::vector<int> dp(N + 1);
11
12
// 0 coins are needed for 0 sum
13
0 commit comments