Please help me with code i am not able to understand why time limit is exceeding

this code is giving me TLE , although i have used the techniques given in the hint

Hello @akshpreetsinghs please share your code by saving it on Ide.codingblocks.com