private static int transpositions(final CharSequence first,final CharSequence second){
  int transpositions=0;
  for (int i=0; i < first.length(); i++) {
    if (first.charAt(i) != second.charAt(i)) {
      transpositions++;
    }
  }
  return transpositions / 2;
}

private static int transpositions ( final CharSequence first , final CharSequence second ) { int transpositions = 0 ; for ( int i = 0 ; i < first . length ( ) ; i ++ ) { if ( first . charAt ( i ) != second . charAt ( i ) ) { transpositions ++ ; } } return transpositions / 2 ; }
calculates the number of transposition between two strings .
