Could you please tell where i am going wrong in the recursive part?https://ide.codingblocks.com/s/203504
Subset Sum Easy .Help needed in debugging
Hi @utkarshvashisth94, there are some errors in your code
- you are not considering the case when there is no element in the subset
- you have put the condition that when a[i]>sum u won;t include it in the subset , which is wrong as we may encounter a negative number in the subset making the subset sum as zero
In have updated your code a bit:-