C-edge's transaction monitoring pipeline receives two unsorted arrays of integer values from separate processing stages. Given arrays a and b, find one value from each array whose absolute difference is as small as possible.
Return the pair as [x, y], where x comes from a and y comes from b. If multiple pairs have the same minimum difference, return the lexicographically smallest pair: choose the smaller x, then the smaller y.
Implement closest_pair(a, b).
a and b.[x, y] such that x belongs to a, y belongs to b, and abs(x - y) is minimal.def closest_pair(a, b):