Java | BFS | Faster than 100%
```\nclass Solution {\n    public int[][] highestPeak(int[][] isWater) {\n        int n = isWater.length;\n        int m = isWater[0].length;\n        int[][] d
```\nclass Solution {\n    public int[][] highestPeak(int[][] isWater) {\n        int n = isWater.length;\n        int m = isWater[0].length;\n        int[][] dirs = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};\n        int[][] mat = new int[n][m];\n        Queue<int[]> queue = new LinkedList<>();\n        for (int i = 0; i < n; i++) {\n             Arrays.fill(mat[i], -1);\n            for (int j = 0; j < m; j++) {\n               \n                if (isWater[i][j] == 1) {\n                    mat[i][j] = 0;\n                    queue.add(new int[]{i, j});\n                }\n            }\n        }\n        \n        while (!queue.isEmpty()) {\n            int[] cur = queue.poll();\n            for (int[] dir : dirs) {\n                int x = cur[0] + dir[0];\n                int y = cur[1] + dir[1];\n                if (x < 0 || y < 0 || x >= n || y >= m || mat[x][y] != -1) continue;\n                mat[x][y] = mat[cur[0]][cur[1]] + 1;\n                queue.add(new int[]{x, y});\n            }\n        }\n        return mat;\n    }\n}
['Breadth-First Search', 'Java']