Easiest BFS
\nclass Solution {\npublic:\n    //bfs\n    vector<vector<int>> highestPeak(vector<vector<int>>& isWater) {\n        vector<vector<int>> ans(isWater.size(),vect
```\nclass Solution {\npublic:\n    //bfs\n    vector<vector<int>> highestPeak(vector<vector<int>>& isWater) {\n        vector<vector<int>> ans(isWater.size(),vector<int>(isWater[0].size(),-1));\n        queue<pair<int,int>> que;\n        for(int i=0;i<isWater.size();i++){\n            for(int j=0;j<isWater[0].size();j++){\n                if(isWater[i][j]==1){\n                    que.push({i,j});\n                    ans[i][j]=0;\n                }\n            }\n        }\n        int dir[]={-1,0,1,0,-1};\n        while(!que.empty()){\n            int i,j;\n            tie(i,j)=que.front();que.pop();\n            for(int k=0;k<4;k++){\n                int ni=i+dir[k],nj=j+dir[k+1];\n                if(ni<0||ni>=isWater.size()||nj<0||nj>=isWater[0].size()||ans[ni][nj]!=-1)continue;\n                ans[ni][nj]=ans[i][j]+1;\n                que.push({ni,nj});\n            }\n            \n        }\n        return ans;\n    }\n};\n```
['Breadth-First Search', 'C']