[C++] Parallel BFS Solution
\nint rowDelta[] = { 0, +1, 0, -1 };\nint colDelta[] = { +1, 0, -1, 0 };\n\nclass Solution\n{\npublic:\n    vector<vector<int>> highestPeak(vector<vector<int>>&
```\nint rowDelta[] = { 0, +1, 0, -1 };\nint colDelta[] = { +1, 0, -1, 0 };\n\nclass Solution\n{\npublic:\n    vector<vector<int>> highestPeak(vector<vector<int>>& isWater)\n    {\n        int R = isWater.size();\n        int C = isWater[0].size();\n                \n        queue<pair<int, int>> q;\n        \n        for (int r = 0; r < R; ++r)\n            for (int c = 0; c < C; ++c)\n                if (isWater[r][c] == 1)\n                    isWater[r][c] = 0,\n                    q.push({ r, c });   // add as a starting point\n                else\n                    isWater[r][c] = -1; // mark unvisited\n        \n        while (q.size() > 0)\n        {\n            int r = q.front().first;\n            int c = q.front().second;\n            q.pop();\n            \n            for (int d = 0; d < 4; ++d)\n            {\n                int nr = r + rowDelta[d];\n                int nc = c + colDelta[d];\n                \n                if (nr < 0 ||\n                    nr == R ||\n                    nc < 0 ||\n                    nc == C ||\n                    isWater[nr][nc] != -1)\n                        continue;\n                \n                isWater[nr][nc] = isWater[r][c] + 1;\n                q.push({ nr, nc });\n            }\n        }\n        \n        return isWater;\n    }\n};\n```
[]