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