Code gives wrong answer for the prob

// this is the hackerblock problem

https://hack.codingblocks.com/app/practice/1/1044/problem

//this is the code

hello @thakur0_0 please share your code you have only shared the quesiton link .

hey @thakur0_0 don’t you think that your code is producing the correct answer for the sample test case ?

i have just checked it was giving run error in one test case.
this was because the problem was in the array initialization part in line 37 .
this is the correction
int a[100005]={0};
declare your array like this
just make this correction and your code will pass every test case .
if you feel that your doubt is cleared please mark this doubt as resolved .
Happy Learning !!

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.