triplea and tripleb have two integer arrays
A=[a1,a2,…,an] and
B=[b1,b2,…,bm], respectively. One day they came up with the following problem:
-
Does there exists a pair of numbers in arrays A and B, such that their absolute difference is the same?
However, triplea and tripleb care about their data privacy, so they don't want to expose their array directly to each other. That's why they turn to you------triplec. Can you help them solve this problem?
Formally, you need to determine: do there exist four indices
1≤i,j≤n,1≤k,l≤m, such that
i≠j,
k≠l and
|ai-aj|=|bk-bl|.