Skip to content

Commit c042f3d

Browse files
authored
Update bricks-falling-when-hit.cpp
1 parent 27aa0f1 commit c042f3d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

C++/bricks-falling-when-hit.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ class Solution {
3535

3636
vector<int> result;
3737
for (int i = hits.size() - 1; i >= 0; --i) {
38-
int r = hits[i][0], c = hits[i][1];
38+
const auto r = hits[i][0], c = hits[i][1];
3939
const auto prev_roof = union_find.top();
4040
if (grid[r][c] == 0) {
4141
result.emplace_back(0);
4242
continue;
4343
}
4444
for (const auto& d : directions) {
45-
int nr = r + d.first, nc = c + d.second;
45+
const auto nr = r + d.first, nc = c + d.second;
4646
if (0 <= nr && nr < R &&
4747
0 <= nc && nc < C &&
4848
hit_grid[nr][nc]) {

0 commit comments

Comments
 (0)