Python BOXGAM97 NZEC error

could not understand what wrong with my code :frowning:

please help!
problem: BOXGAM97 OCT Lunchtime
solution: https://www.codechef.com/viewsolution/27581263

i tried but again NZEC error
https://www.codechef.com/viewsolution/27597349
@anon70990627

Am i missing something? What’s the * next to max1?

its max1 multiplied by -1

in ide my code works fine but in codechef it gives NZEC

You have out of index error when max element is in first place.

Input test case:

1
2 3 1
2 1
2 Likes

thanks for your help