public int ladderLength(String start, String end, HashSet<String> dict) {
        if (start.equals(end) || !dict.contains(start) || !dict.contains(end) || dict.size() < 2) {
            return 0;
        }
        buildNet(start, end, dict);
        Queue<Node> q = new LinkedList<Node>();
        q.add(startNode);
        while (!q.isEmpty()) {
            Node node = q.poll();
            if (node.stat == Status.FUCKED) {
                continue;
            } else if (node.word.equals(end)) {
                return node.step;
            }
            node.stat = Status.FUCKED;
            for (Node neighbor: node.neighbors) {
                if (neighbor.stat == Status.VIRGIN) { // only add virgin
                    neighbor.step = node.step + 1;
                    neighbor.stat = Status.INQUEUE;
                    q.add(neighbor);
                }
            }
        }
        return 0;
    }