Subset Sum Easy .Help needed in debugging

Could you please tell where i am going wrong in the recursive part?https://ide.codingblocks.com/s/203504

Hi @utkarshvashisth94, there are some errors in your code

  1. you are not considering the case when there is no element in the subset
  2. 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:-