Skip to content

Commit 3109437

Browse files
committed
Runtime: 607 ms (Top 6.76%) | Memory: 113.6 MB (Top 19.34%)
1 parent 0dd6e0f commit 3109437

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/algorithms/F/Find All Groups of Farmland/Find All Groups of Farmland.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
// Runtime: 607 ms (Top 6.76%) | Memory: 113.6 MB (Top 19.34%)
12
class Solution {
23
public:
34
vector<vector<int>> nbrs = {{0,1},{1,0},{-1,0},{0,-1}};
45
pair<int, int> dfs(vector<vector<int>> &land, int i, int j, vector<vector<bool>> &visited) {
56
visited[i][j] = true;
6-
pair<int, int> res = make_pair(i, j);
7+
pair<int, int> res = make_pair(i, j);
78
for(auto &nbr: nbrs) {
89
int x = i + nbr[0];
910
int y = j + nbr[1];
@@ -36,4 +37,4 @@ class Solution {
3637
}
3738
return ans;
3839
}
39-
};
40+
};

0 commit comments

Comments
 (0)