WA in CHARGES Problem

Problem Link - Click Here
Link to submission - Click Here

Can anyone point out the test case, where it’s throwing a WA.I have personally tried many test cases, but it’s still throwing a WA.

Thanks in advance!

Hey brother, i have already added that condition in my code.
See line no. 25

I guess, You missed the case , si==1 and di==1 , in line 65…?

I guess you should remove cout<<endl at last.It is creating extra space before each test case.

TC :
1
5 1
01001
3
Answer : 5

1 Like

@hiteshtr1path1, Thank you for the test case.
I did a very blunder mistake at line 51, instead of writing ch=u-1;, i mistakenly wrote ch==u-1;, due to which i got WA, rest all my code was correct.

My AC solution - Click Here