public static void main(String[] args) {
		try (BufferedReader reader = new BufferedReader(new FileReader(
				"src/main/scala/com/me/problems/leetcode/word_ladder_dict_3.txt"))) {
			HashSet<String> dict = new HashSet<String>();
			String line = "";
			while ((line = reader.readLine()) != null) {
				dict.add(line);
			}
			long start = System.currentTimeMillis();
//			ArrayList<ArrayList<String>> ladders = findLadders("charge",
//					"comedo", dict);
//			ArrayList<ArrayList<String>> ladders = findLadders("hit", "cog",
//					dict);
			
//			ArrayList<ArrayList<String>> ladders = findLadders("nape", "mild",
//					dict);
			ArrayList<ArrayList<String>> ladders = findLadders("red", "tax",
					dict);
			long period = System.currentTimeMillis() - start;
			System.out.println("it taks [" + period
					+ "] milliseconds to process");
			for (ArrayList<String> ladder : ladders) {
				String sep = "";
				for (String word : ladder) {
					System.out.print(sep + word);
					if (sep == "") {
						sep = "->";
					}
				}
				System.out.println();
			}

		} catch (IOException ex) {
			ex.printStackTrace();
		}
	}