Choose two elements from the given array such that their sum is not present in any of the arrays | Function to find the numbers from the given arrays such that their sum is not present in any of the given array ; Find the maximum element from both the arrays ; Driver code
function findNum ( a , n , b , m ) { var x = a . reduce ( function ( a , b ) { return Math . max ( a , b ) ; } ) ; var y = b . reduce ( function ( a , b ) { return Math . max ( a , b ) ; } ) ; document . write ( x + " " + y ) ; } var a = [ 3 , 2 , 2 ] ; var n = a . length ; var b = [ 1 , 5 , 7 , 7 , 9 ] var m = b . length ; findNum ( a , n , b , m ) ;