Https://ide.codingblocks.com/s/223283 one anwer is showing wrong

Bhaiya,

I am making every index as the starting index and taking all possible length subset and checking whether it is equal to the sum or not. But geeting one WA.

@Adarshrajpandey
if(a[0] <= sum) b=1; in line 13

but on doing this it is giving Yes of

2 2 1 3 test case which should be No

please give the reason

mam,please tell the reason

@Adarshrajpandey the test case might not be thorough
refer to this correct code:

Is time complexity of my code and this code is same?