Facing Time limit exceeded

eventhough I have submitted the almost the same code but still facing TLE