private boolean bfs(Map<Integer, Map<Integer, Integer>> map, int n, int k) {
        Set<Integer> visited = new HashSet<>();
        Queue<Integer> q = new LinkedList<>();
        q.add(k);
        visited.add(k);
        while (!q.isEmpty()) {
            Integer current = q.remove();
            if (!map.containsKey(current))
                continue;
            for (Integer nei : map.get(current).keySet()) {
                if (!visited.contains(nei)) {
                    visited.add(nei);
                    q.add(nei);
                }
            }
        }

        return visited.size() == n;
    }
Why Did you create this class? what does it do?
src/problems/medium/NetworkDelay.java