title: Smallest Difference Pair Values Two Unsorted Arrays
signature: function smallestDifferencePairValuesTwoUnsortedArrays($a, $b, $m, $n) {
source_py: def smallest_difference_pair_values_two_unsorted_arrays(A, B, m, n):
      A.sort()
      B.sort()
      a = 0
      b = 0
      result = sys.maxsize
      while ((a < m) and (b < n)):
          if (abs((A[a] - B[b])) < result):
              result = abs((A[a] - B[b]))
          if (A[a] < B[b]):
              a += 1
          else:
              b += 1
      return result
source_cpp: int smallest_difference_pair_values_two_unsorted_arrays(vector<int> A, vector<int> B, int m, int n) {
    sort(A.begin(), A.end());
    sort(B.begin(), B.end());
    int a = 0, b = 0;
    int result = INT_MAX;
    while ( a < m && b < n ) {
      if ( abs ( A [ a ] - B [ b ] ) < result ) result = abs ( A [ a ] - B [ b ] );
      if ( A [ a ] < B [ b ] ) a ++;
      else b ++;
    }
    return result;
  }