You are viewing a single comment's thread. Return to all comments →
C++
vector<string> cavityMap(vector<string> &grid) { for (int i = 1; i < grid.size() - 1; i++) { for (int j = 1; j < grid[i].length() - 1; j++) { if (grid[i][j] > grid[i][j - 1] && grid[i][j] > grid[i][j + 1]) { if(grid[i][j] > grid[i-1][j] && grid[i][j] > grid[i+1][j]) { grid[i][j] = 'X'; } } } } return grid; }
Seems like cookies are disabled on this browser, please enable them to open this website
Cavity Map
You are viewing a single comment's thread. Return to all comments →
C++