Skip to content

Commit

Permalink
slightly reformat the code
Browse files Browse the repository at this point in the history
  • Loading branch information
haoel committed Mar 26, 2019
1 parent 97ca258 commit d099f61
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions algorithms/cpp/numberOfIslands/NumberOfIslands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,10 @@ void mark(vector<vector<char> >& grid, int r, int c){

grid[r][c] = 'M';

//left
mark(grid, r, c+1);
//right
mark(grid, r, c-1);
//up
mark(grid, r-1, c);
//down
mark(grid, r+1, c);
mark(grid, r, c+1); //left
mark(grid, r, c-1); //right
mark(grid, r-1, c); //up
mark(grid, r+1, c); //down
}

int numIslands(vector<vector<char> >& grid) {
Expand Down

0 comments on commit d099f61

Please sign in to comment.