s0518
All checks were successful
ci/woodpecker/push/test Pipeline was successful

This commit is contained in:
2023-02-09 17:06:22 +08:00
parent 9a31621c9a
commit 8dc3a66883
4 changed files with 72 additions and 4 deletions

View File

@@ -0,0 +1,27 @@
#include "s0518_coin_change_ii.hpp"
#include <gtest/gtest.h>
TEST(Problem518, Case1) {
vector<int> coins{1, 2, 5};
int amount{5};
int expected{4};
S0518 solution;
EXPECT_EQ(solution.change(amount, coins), expected);
}
TEST(Problem518, Case2) {
vector<int> coins{2};
int amount{3};
int expected{0};
S0518 solution;
EXPECT_EQ(solution.change(amount, coins), expected);
}
TEST(Problem518, Case3) {
vector<int> coins{10};
int amount{10};
int expected{1};
S0518 solution;
EXPECT_EQ(solution.change(amount, coins), expected);
}