<awangdev>Word Ladder II_2.java
public ArrayList<String> expand(String str, Set<String> dict) {
        ArrayList<String> list = new ArrayList<String>();
        for (int i = 0; i < str.length(); i++) {
            for (int j = 0; j < 26; j++) {
                if (str.charAt(i) != (char)('a' + j)) {
                    String newStr = str.substring(0, i) + (char)('a' + j) + str.substring(i + 1);
                    if (dict.contains(newStr)) {
                        list.add(newStr);
                    }
                }
            }
        }
        return list;
    }
public ArrayList < String > var_1 ( String var_2 , Set < String > var_4 ) {
  ArrayList < String > var_6 = new ArrayList < String > ( ) ;
  for ( int var_8 = 0 ;
  var_8 < var_2 . length ( ) ;
  var_8 ++ ) {
    for ( int var_10 = 0 ;
    var_10 < 26 ;
    var_10 ++ ) {
      if ( var_2 . charAt ( var_8 ) != ( char ) ( 'a' + var_10 ) ) {
        String var_16 = var_2 . substring ( 0 , var_8 ) + ( char ) ( 'a' + var_10 ) + var_2 . substring ( var_8 + 1 ) ;
        if ( var_4 . contains ( var_16 ) ) {
          var_6 . add ( var_16 ) ;
        }
      }
    }
  }
  return var_6 ;
}
