C++ || DFS || EASY SOLUTION
class Solution {\n    public:\n\n    int DR[4]={1,0,-1,0};\n    int DC[4]={0,-1,0,1};\n    void dfs(int i,int j,int prev, vector> &ocean, vector> &height){\n   
class Solution {\n    public:\n\n    int DR[4]={1,0,-1,0};\n    int DC[4]={0,-1,0,1};\n    void dfs(int i,int j,int prev, vector<vector<int>> &ocean, vector<vector<int>> &height){\n        int n=height.size();\n        int m=height[0].size();\n        \n        ocean[i][j]=1;\n        \n        for(int k=0;k<4;k++){\n            int ci=i+DR[k];\n            int cj=j+DC[k];\n            \n            if(ci>=0 && ci<n && cj>=0 && cj<m && !ocean[ci][cj] && prev <= height[ci][cj]){\n                dfs(ci,cj,height[ci][cj],ocean,height);\n            }\n        }\n        \n    }\n    vector<vector<int>> pacificAtlantic(vector<vector<int>>& heights) {\n        int n=heights.size();\n        int m=heights[0].size();\n        \n        vector<vector<int>> ans;\n        vector<vector<int>> pacificVis(n,vector<int>(m,0));\n        vector<vector<int>> atlanticVis(n,vector<int>(m,0));\n        \n        for(int j=0;j<m;j++){\n            //1st row\n            dfs(0,j,heights[0][j],pacificVis,heights);\n            //last row\n            dfs(n-1,j,heights[n-1][j],atlanticVis,heights);\n        }\n        \n        for(int i=0;i<n;i++){\n            //1st col\n            dfs(i,0,heights[i][0],pacificVis,heights);\n            //last col\n            dfs(i,m-1,heights[i][m-1],atlanticVis,heights);\n        }\n        \n        for(int i=0;i<n;i++){\n            for(int j=0;j<m;j++){\n                if(pacificVis[i][j] && atlanticVis[i][j]){\n                    ans.push_back({i,j});\n                }\n            }\n        }\n        \n        return ans;\n    }\n};
['Depth-First Search', 'C']