GSS1 spoj, getting wa on the 9th tc

i am not able to find my error,can anyone help me find it in my code.
link :my code

This question has been asked more than thousand time,β€œWA in gss1”,β€œTLE in gss1”,why dont u search before asking!!U can just compare the codes with the correct code!!

1 Like

did that as well, but still not able to figure out my mistake

recheck your merging(formula) for bestleftsum,bestrightsum.