Facing TLE problem in case-2

I had written and submitted my code and getting TLE in case no. 2 even though I have checked and tried on my compiler and not getting similar problem it’s working fine, Please help me with this problem.

is this gonna be answered??