로딩
요청 처리 중입니다...

JAVA_LeetCode 417_Pacific Atlantic Water Flow

 JAVA_LeetCode 417_Pacific Atlantic Water Flow

JAVA_LeetCode 417_Pacific Atlantic Water Flow 풀이 class Solution { private int m, n; private int[][] heights; private static final int[][] DIRS = {{1,0},{-1,0},{0,1},{0,-1}}; // 아래, 위, 오른쪽, 왼쪽 이동 public List pacificAtlantic(int[][] heights) { if(heights == null || heights.length == 0) return new ArrayList(); this.heights = heights; m = heights.length; n = heights[0].length; // 각 바다 배열 boolean[][] pacific = new boolean[m][n]; boolean[][] atlantic = new boolean[m][n]; // Pacific(위,...