Skip to content

Commit 9883903

Browse files
committed
102 Largest Rectangle in Histogram.
1 parent 51c3502 commit 9883903

File tree

9 files changed

+1
-1
lines changed

9 files changed

+1
-1
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.

src/102_largest_rectangle_in_histogram/solution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Solution
4848
position.pop_back();
4949

5050
int idx_low = position.size() > 0 ? position.back() : -1;
51-
ans = max(ans, h * (i - idx_low + 1));
51+
ans = max(ans, h * (i - idx_low - 1));
5252
}
5353

5454
// always push current index into stack, since it can be idx_low for future rectangle
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-412 KB
Binary file not shown.

0 commit comments

Comments
 (0)