WA in EXUND

I wrote code for 30 points and it is giving WA. But I have checked the cases, help with this.
Here is the code link—>CODE

1 Like

I don’t even know why it gives TLE for my solution in last 2 sub-tasks.

Time complexity is O(N) only.

@ [saurabhshadow] Checking ur answer

Pl look at my answer as well and do help.

https://www.codechef.com/viewsolution/27258896