private int transpositions(String text1, String text2) {
        int transpositions = 0;
        for (int i = 0; i < text1.length(); i++) {
            if (text1.charAt(i) != text2.charAt(i)) {
                transpositions++;
            }
        }
        return transpositions;
    }
private int transpositions ( String text1 , String text2 ) { int transpositions = 0 ; for ( int i = 0 ; i < text1 . length ( ) ; i ++ ) { if ( text1 . charAt ( i ) != text2 . charAt ( i ) ) { transpositions ++ ; } } return transpositions ; }
计算两段文本为了保持相等需要的换位次数
@param text1 文本1
@param text2 文本2
@return 换位次数