Please answer this..I am not getting how to display no..also getting "yes" one more time than the answer

add a return value to your function, if you reach the base case return true, if you cannot reach the base case, ie sum == 0 then return false. Print yes or no according to the value returned

@garganshul151 you will need to take care of the case where no elements are chosen and sum is zero

https://ide.codingblocks.com/s/287444…now also after changing some

@garganshul151 print answer for each test case in a new line

https://ide.codingblocks.com/s/287444…i have printed in new line but now it is showing yes for the case when sum=0

@garganshul151 see the base case conditions here https://ide.codingblocks.com/s/288456

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.