Update backtracking/subset_sum.cpp

Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>
This commit is contained in:
Swastika Gupta 2021-07-10 12:43:02 +05:30 committed by GitHub
parent 0387dce9bd
commit 2337303855
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,7 @@ uint64_t subset_sum(uint64_t sum, const std::vector<uint64_t> &in_arr) {
static void test() {
// Test 1
std::cout << "1st test ";
std::vector<int> array1 = {-7, -3, -2, 5, 8}; // input array
std::vector<uint64_t> array1 = {-7, -3, -2, 5, 8}; // input array
assert(backtracking::subset_sum::subset_sum(0, array1) ==
2); // first argument in subset_sum function is the required sum and
// second is the input array