Find the smallest and the largest element in arr2
for ( int i = 0 ; i < m ; i ++ ) { smallest = max ( smallest , arr2 [ i ] ) ; largest = min ( largest , arr1 [ i ] ) ; } for ( int i = 0 ; i < n ; i ++ ) {