pls check my code:
Code gives no output no error
@Garvit012
There are few mistakes in your code
- pass set res in findSum() as reference. So change 4th argument in line 4 to set <vector> &r
- sort ans vector before inserting in set r. just write sort(ans.begin(),ans.end()); before line 6.
- Write return after line 6
- line 13 should be findSum(a,n,j+1,target-a[j],ans,r);
@Garvit012
I have updated your code as per above change. Check it here https://ide.codingblocks.com/s/249083
Thankyou sir…Thanks a lot for your help!!
1 Like
Already done sir! 