반응형 leetcode1 DFS_leetcode numofisland 연결된 부분을 찾을 때 주로 DFS사용 import java.util.*; import java.io.*; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); int m = Integer.parseInt(sc.next()); int[][] grid = new int[n][m]; for(int i=0;i 2021. 9. 23. 이전 1 다음 반응형