Java Simple and easy to understand solution, using BFS, clean code with comments
PLEASE UPVOTE IF YOU LIKE THIS SOLUTION\n\n\nclass Solution {\n    \n    static int[][] DIRECTION = new int[][]{{0, -1}, {0, 1}, {-1, 0}, {1, 0}};\n    int rows
**PLEASE UPVOTE IF YOU LIKE THIS SOLUTION**\n\n```\nclass Solution {\n    \n    static int[][] DIRECTION = new int[][]{{0, -1}, {0, 1}, {-1, 0}, {1, 0}};\n    int rows;\n    int cols;\n    int[][] isWater;\n\n    \n    public int[][] highestPeak(int[][] isWater) {\n        this.isWater = isWater;\n        rows = isWater.length;\n        cols = isWater[0].length;\n        \n\n        int[][] heightCells = new int[rows][cols];\n        \n        //store the coordinate of water cell\n        Queue<int[]> queue = new LinkedList();\n        \n        for(int r = 0; r < rows; r++){\n            for(int c = 0; c < cols; c++){\n                if(isWater[r][c] == 1){\n                    \n                    //mark as water\n                    heightCells[r][c] = 0;\n                    \n                    //add water coordinate\n                    queue.add(new int[]{r, c});\n                } else{\n                    //mark default value for land\n                    heightCells[r][c] = -1;  \n                }\n            }\n        }\n\n        \n        /*\n        * Approach\n        * 1. start from every water source, \n             update their neighbor height\n        * 2. add each neighbours which was not processed earlier\n          3. do it every cell is processed\n        */\n        bfs(queue, heightCells);\n        \n        \n        return heightCells;\n    }\n    \n    private void bfs(Queue<int[]> queue, int[][] heightCells){\n        \n        while(!queue.isEmpty()){\n            int[] cell = queue.remove();\n \n            //increment height of neighbor cell in all 4 direction \n            //e.g, left, right, up, down\n            for(int[] dir : DIRECTION){\n                \n                int newRow = cell[0] + dir[0];\n                int newCol = cell[1] + dir[1]; \n                \n                //check new coordinate of cell inside the grid or not\n                if(!isInsideGrid(newRow, newCol)) continue;\n                \n                //check already handled\n                if(heightCells[newRow][newCol] != -1) continue;\n\n                //increament, \n                heightCells[newRow][newCol] =  heightCells[cell[0]][cell[1]] + 1;\n                \n                //to handle the neighbour of this new cell\n                queue.add(new int[]{newRow, newCol});\n            }\n        \n        }\n    }\n    \n    private boolean isInsideGrid(int row, int col){\n        return row >= 0 && row < rows && col >= 0 && col < cols;\n    } \n}\n```
['Breadth-First Search', 'Java']