* @param end
     * @param dict
     * @return
     */
    public ArrayList<ArrayList<String>> findLadders(String start, String end, HashSet<String> dict) {
        ArrayList<ArrayList<String>> result = new ArrayList<ArrayList<String>>();
        dict.add(end);
        int size = dict.size();
        ArrayList<String> queue = new ArrayList<String>();
        ArrayList<Integer> parent = new ArrayList<Integer>();
        HashMap<String, Boolean> visited = new HashMap<String, Boolean>();
        for (String s : dict) {
            visited.put(s, false);
        }
        queue.add(start);
        parent.add(-1);

        int cur = 0;
        while (cur < queue.size()) {
            String current = queue.get(cur);
            for (String neighbor : neighbors(current, dict, visited)) {
                if (neighbor.equals(end)) {
                    ArrayList<String> list = new ArrayList<String>();
                    list.add(neighbor);
                    int p = cur;
                    while (p != -1) {
                        list.add(0, queue.get(p));
                        p = parent.get(p);
                    }
                    if (result.size() == 0 || result.get(0).size() == list.size()) {
                        result.add(list);
                    } else if (list.size() < result.get(0).size()) {
                        result.clear();
                        result.add(list);
                    }
                    visited.put(neighbor, false);
                } else {
                    queue.add(neighbor);
                    parent.add(cur);
                    visited.put(neighbor, true);
                }
            }
            cur++;
        }

        return result;

    }