All pastes #715500 Raw Edit

Mine

public java v1 · immutable
#715500 ·published 2007-09-26 10:55 UTC
rendered paste body
     // check for words where one letter is missing     public String[] similarRem(String word) {         char[] wordArr = word.toCharArray();         char[] tmp = wordArr.clone();         String[] words = new String[wordArr.length];          // remove a letter at a time         for (int i = 0; i < wordArr.length; i++) {             words[i] = rem(i, tmp);             System.out.println(tmp);             tmp = wordArr.clone();         }          return words;     }     // helper method for similarRem()     private String rem(int a, char[] word) {         char[] tmp = new char[word.length];                                                                                                                      for (int i = 0; i < word.length; i++)             if (word[i] != word[a])                 tmp[i] = word[i];          return new String(tmp);     }