Tilling Problem MLE error

Hello sir/ma’am,
my code for this problem shows MLE error for test case 2 and 4. Please tell why is it showing this error.
Sharing my code:

Hello @Akshita99,

I have corrected your code:

Refer to the comments.

Hope, this would help.

Yeah ok…understood! Thank you sir!!