public int ladderLength(String start, String end, HashSet<String> dict) {
		// Start typing your Java solution below
		// DO NOT write main() function\
		//mlgb, zhen bu rong yi....
		LinkedList<String> queue = new LinkedList<String>();
		queue.add(start);
		String lastFirst = start;
		int ret = 1;
		if(dict.contains(start)) dict.remove(start);
		while (!queue.isEmpty()) {
			String e = queue.removeFirst();
			if (e.equals(lastFirst)) {
				lastFirst = null;
				ret++;
			}
			for (int i = 0; i < e.length(); i++) {
				char cur = e.charAt(i);
				for (int j = 0; j < 26; j++) {
					StringBuilder sb = new StringBuilder(e);
					char alt = (char)('a' + j);
					if(alt == cur) continue;
					sb.setCharAt(i, alt);
					String s = sb.toString();
					if (dict.contains(s)) {
						queue.addLast(s);
						dict.remove(s);
						if (lastFirst == null) {
							lastFirst = s;
						}
					}
					if(s.equals(end)) return ret;
				}
			}
		}
		return 0;

	}