question: public int diff_commonPrefix ( String text1 , String text2 ) { int n = Math . min ( text1 . length ( ) , text2 . length ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( text1 . charAt ( i ) != text2 . charAt ( i ) ) { return i ; } } return n ; }
target:  Determine the common prefix of two strings