We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f49208d commit 934e6c5Copy full SHA for 934e6c5
src/0039-Combination-Sum/0039.cpp
@@ -24,7 +24,7 @@ class Solution
24
res.push_back(path);
25
return;
26
}
27
- if (!path.empty() and target < *(path.end() - 1)) return;
+ if (!path.empty() and target < *(path.rbegin())) return;
28
for (unsigned int i = index; i < candidates.size(); ++i)
29
{
30
path.push_back(candidates[i]);
0 commit comments