Kindly check my code

why is the out array not forming properly and is printing garbage values?

ur code
is adding the nunmber in out array
irrespective of whether u are considering it in the sum or not

ur code


but this will give YES always
check out my code of how i have used recursion

kindly reply…

kindly check this one https://ide.codingblocks.com/s/285749

this code u shared in the last is working fine on all teest cases

@chhavibansal can why we are taking the null in the base case the input is arrays not string

where is null taken ???

@chhavibansal in base case


why are doing like this when arrays reaches to end. if i == n

I am also trying to solve this problems in this ways but getting unknown sum

Approaches :slight_smile:

  1. Generate all the subset
  2. take the sum and printout the sum in the base case

chal raha h code @Vikaspal???

@chhavibansal nope approach right hai but not working

can u make a separate doubt thread?
better for 3 of u s