Skip to content

Commit eb34922

Browse files
authored
Update trapping-rain-water-ii.cpp
1 parent 11a63f4 commit eb34922

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/trapping-rain-water-ii.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Solution {
2525
heap_.emplace(Cell{i, n_ - 1, heightMap[i][n_ - 1]});
2626
is_visited_[i][n_ - 1] = true;
2727
}
28-
for (int j = 0; j < n_; ++j) {
28+
for (int j = 1; j < n_ - 1; ++j) {
2929
heap_.emplace(Cell{0, j, heightMap[0][j]});
3030
is_visited_[0][j] = true;
3131
heap_.emplace(Cell{m_ - 1, j, heightMap[m_ - 1][j]});

0 commit comments

Comments
 (0)