문제 유형Grpah - BFS작성 코드import java.util.*;public class Main { static int N, M; static Map> nodeMap; static int[] visited; public static void input() { Scanner sc = new Scanner(System.in); // # of nodes N = sc.nextInt(); // # of relationship M = sc.nextInt(); nodeMap = new HashMap(); for (int i = 1; i ()); } for (int i = 0; ..