A Function that returns the longest common prefix from the array of strings
function commonPrefix ( arr , n ) { let prefix = arr [ 0 ] ; for ( let i = 1 ; i <= n - 1 ; i ++ ) { prefix = commonPrefixUtil ( prefix , arr [ i ] ) ; } return ( prefix ) ; }