Ultimate approach, i bet u cant find a better one


#1
int i=0,j=0,k=0;
int min=Integer.MAX_VALUE;
    while(i<A.length&&j<B.length&&k<C.length){
        int diff=Math.max(Math.max(A[i],B[j]),C[k])-Math.min(Math.min(A[i],B[j]),C[k]);
        if(diff<min){
            min=diff;
        }
        if(A[i]<=B[j]&&A[i]<=C[k]){
            i++;
        }else if(B[j]<=C[k]&&B[j]<=A[i]){
            j++;
        }else{
            k++;
        }
    }
    return min;

#2

in python3:
def solve(self,A, B, C):
a, b, c = 0, 0, 0
mini = int(1e9)
while (a < len(A)) & (b < len(B)) & (c < lenĀ©):
maxx, minn = max(A[a], B[b], C[c]), min(A[a], B[b], C[c])
if abs(maxx - minn) < mini:
mini = abs(maxx - minn)
if minn == A[a]:
a += 1
elif minn == B[b]:
b += 1
else:
c += 1
return mini


#3

can you explain why you have done (A[i]<=B[j]&&A[i]<=c[k])that i think you have taken if A[i] will be min among all three but i dont understand that i++.