Driver Code
let mat = [ [ 1 , 2 , 3 , 4 , 5 ] , [ 2 , 4 , 5 , 8 , 10 ] , [ 3 , 5 , 7 , 9 , 11 ] , [ 1 , 3 , 5 , 7 , 9 ] ] ; let result = findCommon ( mat ) if ( result == - 1 ) { document . write ( " " ) ; } else { document . write ( " " , result ) ; }