title: Count Pairs Two Sorted Arrays Whose Sum Equal Given Value X 2
signature: function countPairsTwoSortedArraysWhoseSumEqualGivenValueX2(arr1, arr2, m, n, x) {
source_py: def count_pairs_two_sorted_arrays_whose_sum_equal_given_value_x_2(arr1, arr2, m, n, x):
      (count, l, r) = (0, 0, (n - 1))
      while ((l < m) and (r >= 0)):
          if ((arr1[l] + arr2[r]) == x):
              l += 1
              r -= 1
              count += 1
          elif ((arr1[l] + arr2[r]) < x):
              l += 1
          else:
              r -= 1
      return count
source_cpp: int count_pairs_two_sorted_arrays_whose_sum_equal_given_value_x_2(vector<int> arr1, vector<int> arr2, int m, int n, int x) {
    int count = 0;
    int l = 0, r = n - 1;
    while ( l < m && r >= 0 ) {
      if ( ( arr1 [ l ] + arr2 [ r ] ) == x ) {
        l ++;
        r --;
        count ++;
      }
      else if ( ( arr1 [ l ] + arr2 [ r ] ) < x ) l ++;
      else r --;
    }
    return count;
  }