Easy C++ BFS solution || commented
\nclass Solution {\npublic:\n    vector<vector<int>> highestPeak(vector<vector<int>>& isWater) {\n        \n        //push all the indices which have water to q
```\nclass Solution {\npublic:\n    vector<vector<int>> highestPeak(vector<vector<int>>& isWater) {\n        \n        //push all the indices which have water to queue\n        //now pop out cell from queue and assign the adjacent cells with a height value greater by 1\n        queue<pair<int,int>> q;\n        int currHeight=1;\n        vector<vector<int>> offsets={{1,0},{0,1},{-1,0},{0,-1}};\n        \n        int m=isWater.size();\n        int n=isWater[0].size();\n        vector<vector<int>> res(m,vector<int>(n,-1));\n        for(int i=0;i<m;i++)\n        {\n            for(int j=0;j<n;j++)\n            {\n                if(isWater[i][j]==1)\n                {\n                    //it has water\n                    q.push({i,j});\n                    res[i][j]=0;\n                }\n            }\n        }\n        while(!q.empty())\n        {\n            int len=q.size();\n            for(int i=0;i<len;i++)\n            {\n                auto [x,y] = q.front();\n                q.pop();\n                //assign every adjacent cell with the currHeight;\n                for(int j=0;j<4;j++)\n                {\n                    int X=x+offsets[j][0];\n                    int Y=y+offsets[j][1];\n                    if(X<0 || Y<0 || X>=m || Y>=n || res[X][Y]!=-1)\n                        continue;\n                    res[X][Y]=currHeight;\n                    q.push({X,Y});\n                }\n            }\n            currHeight++;\n        }\n        return res;\n    }\n};\n```\n**Upvote if this helps you :)**
['C']