由买买提看人间百态

topics

全部话题 - 话题: ndup
(共0页)
w****x
发帖数: 2483
1
来自主题: JobHunting版 - 今天做了挺难的一道题, 分享一下
//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 == ... 阅读全帖
(共0页)