mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
Update backtracking/subset_sum.cpp
Co-authored-by: Filip Hlasek <fhlasek@gmail.com>
This commit is contained in:
parent
a32b32f01c
commit
1328571ca4
@ -30,7 +30,7 @@ namespace Subsets {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
std::uint64_t subset_sum(int sum, const std::vector<int> &in_arr) {
|
std::uint64_t subset_sum(int sum, const std::vector<int> &in_arr) {
|
||||||
int nelement = in_arr.size(); // number of subset element
|
int nelement = in_arr.size();
|
||||||
int count_of_subset = 0;
|
int count_of_subset = 0;
|
||||||
|
|
||||||
for (int i = 0; i < (1 << (nelement)); i++) {
|
for (int i = 0; i < (1 << (nelement)); i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user