SLPCYCLE question help

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

can someone help me where i went wrong .The code passed the examples testcases but failed in submission.

code logic:Spliiting the substring withhas continuos zeros and then converting them to int by their length and subtracting it from H given in question.

1 Like

Dude you have missed the condition that
h=min(h,2*(h-a[i])) you have to take whatever is minimum not every value . you can check my submission here CodeChef: Practical coding for everyone

1 Like