Correct answer but going to TLE why?


#1

int lenA = A.size();
int lenB = B.size();
int lenC = C.size();
int i = lenA-1;
int j = lenB-1;
int k = lenC-1;
int mindiff=INT_MAX;
while(i>=0 and j>=0 and k>=0)
{
int maxx = max(A[i],max(B[j],C[k]));
int minn = min(A[i],min(B[j],C[k]));
if(mindiff>(maxx-minn))
{
mindiff = (maxx-minn);
}
if(maxx==A[i])
i–;
else if(maxx=B[j])
j–;
else if(maxx==C[k])
k–;
}


#2

maxx==B[j] and in your code it’s maxx=B[j]


#3

there is missing of return statement.