Passing only 4/5 test cases

Hello @ikshuldureja130,

  • Remove this line

m.insert({0,1});

  • Add, this inside for loop

sum += nums[i];
if(sum==k){
ans++;
}

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.

I did as you said and It is still passing only 4 out of 5 test cases…is it possible that one of the test case is wrong?

@ikshuldureja130,
just change int to long long your code is fine

It worked…Thank you

1 Like

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.