We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 27aa0f1 commit c042f3dCopy full SHA for c042f3d
C++/bricks-falling-when-hit.cpp
@@ -35,14 +35,14 @@ class Solution {
35
36
vector<int> result;
37
for (int i = hits.size() - 1; i >= 0; --i) {
38
- int r = hits[i][0], c = hits[i][1];
+ const auto r = hits[i][0], c = hits[i][1];
39
const auto prev_roof = union_find.top();
40
if (grid[r][c] == 0) {
41
result.emplace_back(0);
42
continue;
43
}
44
for (const auto& d : directions) {
45
- int nr = r + d.first, nc = c + d.second;
+ const auto nr = r + d.first, nc = c + d.second;
46
if (0 <= nr && nr < R &&
47
0 <= nc && nc < C &&
48
hit_grid[nr][nc]) {
0 commit comments