w****x 发帖数: 2483 | 1 //Print All different Combinations of a Number as a Sum of Candidate Numbers
//Before start coding, several things to consider
//1. How to deal with duplicated numbers (sort them)
//2. What exactly is the successful ending condition
//3. What exactly is the failure ending condition
//4. For the container, pass by reference or by value
void _inner_print(int a[], int n, int nSum, vector& vecRes)
{
//the success ending condition is nSum == 0 and at the
//same time n == 0!! not nSum == ... 阅读全帖 |
|