https://school.programmers.co.kr/learn/courses/30/lessons/43162 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr # DFS 코드class Solution { public int solution(int n, int[][] computers) { boolean[] visited = new boolean[n]; // 각 컴퓨터의 방문 여부 체크 배열 int answer = 0; for (int i = 0; i DFS/BFS 모두 방문 여부를 체크하는 visited 배열이 2차원이 아니라 1차원인 이유 : 방문 여부를 ..