***************** Java Solution ******************************* class Solution { public List pacificAtlantic(int[][] heights) { if (heights.length == 0 || heights[0].length == 0){ return new ArrayList(); } int row = heights.length; int col = heights[0].length; boolean[][] pacificReachable = new boolean[row][col]; boolean[][] atlanticReachable = new boolean[row] [col]; for(int i=0; i