Skip to content

Commit a15a6f0

Browse files
committed
Update surrounded-regions.cpp
1 parent aab7cf9 commit a15a6f0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

C++/surrounded-regions.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ class Solution {
1010

1111
queue<pair<int, int>> q;
1212
for (int i = 0; i < board.size(); ++i) {
13-
q.emplace(make_pair(i, 0));
14-
q.emplace(make_pair(i, board[0].size() - 1));
13+
q.emplace(i, 0);
14+
q.emplace(i, board[0].size() - 1);
1515
}
16-
1716
for (int j = 0; j < board[0].size(); ++j) {
18-
q.emplace(make_pair(0, j));
19-
q.emplace(make_pair(board.size() - 1, j));
17+
q.emplace(0, j);
18+
q.emplace(board.size() - 1, j);
2019
}
20+
2121
while (!q.empty()) {
2222
int i, j;
2323
tie(i, j) = q.front();
@@ -32,7 +32,7 @@ class Solution {
3232
0 <= y && y < board[0].size() &&
3333
board[x][y] == 'O') {
3434
board[x][y] = 'V';
35-
q.emplace(make_pair(x, y));
35+
q.emplace(x, y);
3636
}
3737
}
3838
}

0 commit comments

Comments
 (0)