| 52 | } |
| 53 | |
| 54 | int main(int argc, char const *argv[]) |
| 55 | { |
| 56 | vector<int> candidates; |
| 57 | // {5, 10, 12, 13, 15, 18} |
| 58 | int n; |
| 59 | int target; |
| 60 | cout << "Enter the number of candidates: "; |
| 61 | cin >> n; |
| 62 | cout<<"Enter the target: "; |
| 63 | cin >> target; |
| 64 | cout << "Enter the candidates: "; |
| 65 | for(int i=0;i<n;i++) |
| 66 | { |
| 67 | int candidate; |
| 68 | cin >> candidate; |
| 69 | candidates.push_back(candidate); |
| 70 | } |
| 71 | combinationSum(candidates, target); |
| 72 | |
| 73 | |
| 74 | return 0; |
| 75 | } |
| 76 | |
| 77 | // Time Complexity : |
| 78 | // O((2^n)*k*logn) |
nothing calls this directly
no test coverage detected