Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DailyTemperatures ¶
type DailyTemperatures struct { }
*
- @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}
func (*DailyTemperatures) GetAttribute ¶
func (m *DailyTemperatures) GetAttribute() *C.Attribute
func (*DailyTemperatures) NextValue ¶
func (m *DailyTemperatures) NextValue(array []int) []int
type DailyTemperatures2 ¶
type DailyTemperatures2 struct { }
*
- @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}
func (*DailyTemperatures2) GetAttribute ¶
func (m *DailyTemperatures2) GetAttribute() *C.Attribute
func (*DailyTemperatures2) NextValue ¶
func (m *DailyTemperatures2) NextValue(array []int) []int
type GetMinValueByRemoveK ¶
type GetMinValueByRemoveK struct { }
*
- @author ljfirst
- @version V1.0
- @date 2023/6/28 19:13
- @author-Email ljfirst@mail.ustc.edu.cn
- @blogURL https://blog.csdn.net/ljfirst
- @description 移掉 K 位数字
- 给你一个以字符串表示的非负整数 num 和一个整数 k ,移除这个数中的 k 位数字,
- 使得剩下的数字最小。请你以字符串形式返回这个最小的数字。
- input:num = "1432219", k = 3
- output:"1219"
- <p>
- input:num = "10200", k = 1
- output:"200"
- <p>
- input:num = "10", k = 2
- output:"0" *
func (*GetMinValueByRemoveK) GetAttribute ¶
func (m *GetMinValueByRemoveK) GetAttribute() *C.Attribute
func (*GetMinValueByRemoveK) Method ¶
func (m *GetMinValueByRemoveK) Method()
type MonotonousStack ¶
type MonotonousStack struct { }
*
- @author ljfirst
- @version V1.0
- @date 2023/6/28 19:10
- @author-Email ljfirst@mail.ustc.edu.cn
- @blogURL https://blog.csdn.net/ljfirst
- @description 单调栈 下一个更大元素
- 给一个数组,返回一个等长的数组,对应索引存储着下一个更大元素,如果没有更大的元素,就存 -1.
- 另一道相似题目:https://leetcode-cn.com/problems/daily-temperatures/
- input: {2, 1, 2, 4, 3}
- output: {4, 2, 4, -1, -1} *
func (*MonotonousStack) GetAttribute ¶
func (m *MonotonousStack) GetAttribute() *C.Attribute
func (*MonotonousStack) NextValue ¶
func (m *MonotonousStack) NextValue(array []int) []int
Click to show internal directories.
Click to hide internal directories.