Getting TLE in this pronlem

Problem Link:

My Solution:

hello @tasfikrahman007 please wait for some time as i have to understand the question and then i have to find the problem with your code

hey @tasfikrahman007 the question is not so difficult read the question again again and try to analyse your code .
there must be side case which you are not handling .

for that reason I should have got WA but its giving TLE, can u point out exactly where I have messed up?

@tasfikrahman007 no is some edge cases if you done handle then you can get tle as well .
but still wait let me check now .

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.