Code gives no output no error

pls check my code:

@Garvit012
There are few mistakes in your code

  1. pass set res in findSum() as reference. So change 4th argument in line 4 to set <vector> &r
  2. sort ans vector before inserting in set r. just write sort(ans.begin(),ans.end()); before line 6.
  3. Write return after line 6
  4. 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

@Garvit012
welcome :slight_smile: Mark this doubt as resolved.

Already done sir! :slight_smile: