Same code different behaviour

Solution link (TLE) :

Solution link (Accepted):

Question Link :

Why is there TLE , both are having the same procedure and approach ?

Most probably , expression dis=xx+yy
will be overflow as x and y are of type integer , variable dis will become negative(dis<0) and hence it never comes out of while loop


Okay . Thanks @nihar_99