1 Star 0 Fork 0

ljfirst/algo-go-sdk

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
DailyTemperatures2.go 887 Bytes
一键复制 编辑 原始数据 按行查看 历史
ljfirst 提交于 2023-07-04 23:35 +08:00 . feat: PriorityQueue
package monotonousStack
import C "gitee.com/ljfirst/algo-go-sdk/common/constant"
/**
* @author ljfirst
* @version V1.0
* @date 2023/6/28 19:09
* @author-Email ljfirst@mail.ustc.edu.cn
* @blogURL https://blog.csdn.net/ljfirst
* @description 单调栈【每日温度】
* 请根据每日 气温 列表 temperatures ,请计算在每一天需要等几天才会有更高的温度。
* 如果气温在这之后都不会升高,请在该位置用 0 来代替。
* input: {73,74,75,71,69,72,76,73}
* output: {1, 1, 4, 2, 1, 1, 0, 0}
*/
type DailyTemperatures2 struct {
}
func (m *DailyTemperatures2) NextValue(array []int) []int { return nil }
func (m *DailyTemperatures2) GetAttribute() *C.Attribute {
return &C.Attribute{
Tags: []string{C.MonotonousStack},
Desc: &C.Desc{
Name: "DailyTemperatures2",
NameCn: "下一日更高的温度:从前往后推",
},
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/ljfirst/algo-go-sdk.git
git@gitee.com:ljfirst/algo-go-sdk.git
ljfirst
algo-go-sdk
algo-go-sdk
v1.0.3

搜索帮助