We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aab7cf9 commit a15a6f0Copy full SHA for a15a6f0
C++/surrounded-regions.cpp
@@ -10,14 +10,14 @@ class Solution {
10
11
queue<pair<int, int>> q;
12
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));
+ q.emplace(i, 0);
+ q.emplace(i, board[0].size() - 1);
15
}
16
-
17
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));
+ q.emplace(0, j);
+ q.emplace(board.size() - 1, j);
20
+
21
while (!q.empty()) {
22
int i, j;
23
tie(i, j) = q.front();
@@ -32,7 +32,7 @@ class Solution {
32
0 <= y && y < board[0].size() &&
33
board[x][y] == 'O') {
34
board[x][y] = 'V';
35
- q.emplace(make_pair(x, y));
+ q.emplace(x, y);
36
37
38
0 commit comments