Simple Solution
\n\n# Code\n\nclass Solution:\n    def pacificAtlantic(self, h: List[List[int]]) -> List[List[int]]:\n        n, m = len(h), len(h[0])\n        isPacc = [[True 
\n\n# Code\n```\nclass Solution:\n    def pacificAtlantic(self, h: List[List[int]]) -> List[List[int]]:\n        n, m = len(h), len(h[0])\n        isPacc = [[True if i == 0 or j == 0 else False for j in range(m)] for i in range(n)]\n        isAtl = [[True if i == n - 1 or j == m - 1 else False for j in range(m)] for i in range(n)]\n        \n        def Pac(i, j, isPac):\n            val = h[i][j]\n            for x, y in [(i+1, j), (i-1, j), (i, j+1), (i, j-1)]:\n                if 0 <= x < n and 0 <= y < m and not isPac[x][y] and h[x][y] >= val:\n                    isPac[x][y] = True\n                    Pac(x, y, isPac)\n        \n        for i in range(n): Pac(i, 0, isPacc)\n        for j in range(m): Pac(0, j, isPacc)\n        for i in range(n): Pac(i, m-1, isAtl)\n        for j in range(m): Pac(n-1, j, isAtl)\n        \n        return [[i, j] for i in range(n) for j in range(m) if isPacc[i][j] and isAtl[i][j]]\n\n```
['Python3']