From d099f61945b473c9dbb0d507ac948afd7f29d67a Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Tue, 26 Mar 2019 17:13:08 +0800 Subject: [PATCH] slightly reformat the code --- algorithms/cpp/numberOfIslands/NumberOfIslands.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/algorithms/cpp/numberOfIslands/NumberOfIslands.cpp b/algorithms/cpp/numberOfIslands/NumberOfIslands.cpp index 2eea8a877..9c5d140ee 100644 --- a/algorithms/cpp/numberOfIslands/NumberOfIslands.cpp +++ b/algorithms/cpp/numberOfIslands/NumberOfIslands.cpp @@ -39,14 +39,10 @@ void mark(vector >& 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 >& grid) {