I am getting tle and runtime error in two test case

pl debug: https://ide.codingblocks.com/s/217225

@spagire4
hello shubham,
i have check ur code it is correct.pls submit after sometime.

check editorial soultion here -> https://ide.codingblocks.com/s/217241

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.