Pls help me to optimise the code as I am getting tle

Hey @Senjuti256
Line 99 should be :

current=next;