1 Star 0 Fork 0

ljfirst/algo-go-sdk

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
GetMinValueByRemoveK.go 958 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: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"
* */
type GetMinValueByRemoveK struct {
}
func (m *GetMinValueByRemoveK) Method() {
}
func (m *GetMinValueByRemoveK) GetAttribute() *C.Attribute {
return &C.Attribute{
Tags: []string{C.MonotonousStack},
Desc: &C.Desc{
Name: "GetMinValueByRemoveK",
NameCn: "移除K个元素,保持整体数值最小",
},
}
}
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

搜索帮助