Can you please tell me what is wrong with my code?

it is passing for
1
0
–––
2
3 -3
–––
4
1 2 3 3
please check and tell me what is wrong with my code

the problem is solved
the problem was
that I was taking β€œbool flag=false;” as a global variable
and when I updated it from function it did not go back to false so for multiple cases if the second case was β€œNO” it was still printing β€œYES”
Question :-subset sum easy
link to soln:-https://ide.codingblocks.com/s/627934