public static ArrayList<ArrayList<String>> findLadders(String start,
			String end, HashSet<String> dict) {
		if (!dict.contains(start) || !dict.contains(end))
			return null;
		int res = 1;
		HashSet<String> toCheck = new HashSet<String>();
		Map<String, Boolean> visit = new HashMap<String, Boolean>();
		Map<String, List<String>> ancestor = new HashMap<String, List<String>>();
		for (String s : dict) {
			visit.put(s, false);
			List<String> list = new ArrayList<String>();
			ancestor.put(s, list);
		}

		toCheck.add(start);
		visit.put(start, true);
		while (!toCheck.contains(end) && toCheck.size() > 0) {
			res++;
			HashSet<String> newStrs = new HashSet<String>();
			for (String s : toCheck) {
				newStrs.addAll(oneDiffStrs(s, dict, visit, ancestor));
			}
			for (String s : newStrs)
				visit.put(s, true);
			toCheck = newStrs;
//			System.out.println(toCheck);
		}
		ArrayList<ArrayList<String>> finalRes = new ArrayList<ArrayList<String>>();
		if (toCheck.contains(end)) {
			String[] results = new String[res];
			results[0] = end;
			visitPath(end, ancestor, results, 1, finalRes);
		}
//		System.out.println(ancestor);
		return finalRes;
	}