You are viewing a single comment's thread. Return to all comments →
int left = 1; int right = grid[0].size() - 2; int top = 1; int bottom = grid.size() - 2; for (int i = top; i <= bottom; i++) { for (int j = left; j <= right; j++) { if (grid[i - 1][j] < grid[i][j] and grid[i + 1][j] < grid[i][j] and grid[i][j - 1] < grid[i][j] and grid[i][j + 1] < grid[i][j]){ // cout<<"here"; 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 →