mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-15 07:20:40 +08:00
修改 0084.柱状图中最大的矩形 Go单调栈代码的格式
This commit is contained in:
@ -478,7 +478,6 @@ class Solution:
|
|||||||
|
|
||||||
```go
|
```go
|
||||||
func largestRectangleArea(heights []int) int {
|
func largestRectangleArea(heights []int) int {
|
||||||
// 声明max并初始化为0
|
|
||||||
max := 0
|
max := 0
|
||||||
// 使用切片实现栈
|
// 使用切片实现栈
|
||||||
stack := make([]int, 0)
|
stack := make([]int, 0)
|
||||||
@ -507,7 +506,6 @@ func largestRectangleArea(heights []int) int {
|
|||||||
}
|
}
|
||||||
return max
|
return max
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### JavaScript:
|
### JavaScript:
|
||||||
|
Reference in New Issue
Block a user