public static List<String> oneDiffStrs(String str, HashSet<String> dict,
			Map<String, Boolean> visit, Map<String, List<String>> ancestor) {
		List<String> res = new ArrayList<String>();
		for (int i = 0; i < str.length(); i++) {
			for (int j = 0; j < 26; j++) {
				char[] orig = str.toCharArray();
				orig[i] = (char) ('a' + j);
				String newStr = new String(orig);
				if (dict.contains(newStr)) {
					if (visit.get(newStr) == false) {
						res.add(newStr);
						ancestor.get(newStr).add(str);
					}
				}
			}
		}
		return res;
	}