当前位置:网站首页>Sword finger offer 30 Stack containing min function
Sword finger offer 30 Stack containing min function
2022-07-03 19:47:00 【Follow the road to the end】
Defines the data structure of the stack , Please implement a in this type that can get the minimum elements of the stack min The function is in the stack , call min、push And pop The time complexity of O(1).
class MinStack {
constructor () {
// Store stack data
this.data = []
}
// Stack method
push (item) {
this.data.push(item)
}
// Stack method
pop () {
this.data.pop()
}
top () {
return this.data[this.data.length - 1]
}
min () {
return Math.min(...this.data)
}
}1
边栏推荐
- 2022-06-28 网工进阶(十三)IS-IS-路由过滤、路由汇总、认证、影响ISIS邻居关系建立的因素、其他命令和特性
- kubernetes集群搭建efk日志收集平台
- PR 2021 quick start tutorial, how to create new projects and basic settings of preferences?
- Xctf attack and defense world crypto advanced area best_ rsa
- Geek Daily: the system of monitoring employees' turnover intention has been deeply convinced off the shelves; The meta universe app of wechat and QQ was actively removed from the shelves; IntelliJ pla
- Don't be afraid of no foundation. Zero foundation doesn't need any technology to reinstall the computer system
- Make a simple text logo with DW
- Chapter 1: extend the same code decimal sum s (D, n)
- Zhang Fei hardware 90 day learning notes - personal record on day 5. Please see my personal profile / homepage for the complete record
- Chapter 1: drinking soft drinks, step tariff calculation, step tariff calculation function, personal income tax, solving square root inequality, simplifying solving square root inequality, solving dem
猜你喜欢
![2022 - 06 - 30 networker Advanced (XIV) Routing Policy Matching Tool [ACL, IP prefix list] and policy tool [Filter Policy]](/img/b6/5d6b946d8001e2d73c2cadbdce72fc.png)
2022 - 06 - 30 networker Advanced (XIV) Routing Policy Matching Tool [ACL, IP prefix list] and policy tool [Filter Policy]

I study database at station B (4): DQL

Native table - scroll - merge function

第一章:喝汽水,阶梯电费计算,阶梯电费计算函数,个人所税,求解平方根不等式,简化求解平方根不等式,求解调和级数不等式,解不等式:d<1+1/2-1/3+1/4+1/5-1/6+..士1/n
![CesiumJS 2022^ 源码解读[7] - 3DTiles 的请求、加载处理流程解析](/img/70/6fd00146418e5d481e951d51428990.png)
CesiumJS 2022^ 源码解读[7] - 3DTiles 的请求、加载处理流程解析

Typora charges, WTF? Still need support
![Meso tetra [P - (p-n-carbazole benzylidene imino)] phenylporphyrin (tcipp) /eu (tcipp) [pc( α- 2-oc8h17) 4] and euh (tcipp) [pc (a-2-oc8h17) 4] supplied by Qiyue](/img/5b/fc776a1982e24b82984d82be6a016f.jpg)
Meso tetra [P - (p-n-carbazole benzylidene imino)] phenylporphyrin (tcipp) /eu (tcipp) [pc( α- 2-oc8h17) 4] and euh (tcipp) [pc (a-2-oc8h17) 4] supplied by Qiyue

Detailed explanation of shuttle unity interworking principle

原生表格-滚动-合并功能

NFT without IPFs and completely on the chain?
随机推荐
Use of aggregate functions
第一章: 舍罕王失算
Chapter 1: drinking soft drinks, step tariff calculation, step tariff calculation function, personal income tax, solving square root inequality, simplifying solving square root inequality, solving dem
BOC protected amino acid porphyrins TAPP ala BOC, TAPP Phe BOC, TAPP Trp BOC, Zn · TAPP ala BOC, Zn · TAPP Phe BOC, Zn · TAPP Trp BOC Qiyue
Rd file name conflict when extending a S4 method of some other package
The necessity of lean production and management in sheet metal industry
If the warehouse management communication is not in place, what problems will occur?
Nerfplusplus parameter format sorting
HCIA-USG Security Policy
This Chinese numpy quick look-up table is too easy!
Chapter 1: find the algebraic sum of odd factors, find the same decimal sum s (D, n), simplify the same code decimal sum s (D, n), expand the same code decimal sum s (D, n)
Bright purple crystal meso tetra (4-aminophenyl) porphyrin tapp/tapppt/tappco/tappcd/tappzn/tapppd/tappcu/tappni/tappfe/tappmn metal complex - supplied by Qiyue
BOC protected phenylalanine zinc porphyrin (Zn · TAPP Phe BOC) / iron porphyrin (Fe · TAPP Phe BOC) / nickel porphyrin (Ni · TAPP Phe BOC) / manganese porphyrin (Mn · TAPP Phe BOC) Qiyue Keke
Chapitre 1: le roi de shehan a mal calculé
PR FAQ: how to set PR vertical screen sequence?
How to check the permission to write to a directory or file- How do you check for permissions to write to a directory or file?
2. Template syntax
FAQs for datawhale learning!
05 -- QT OpenGL draw cube uniform
FPGA 学习笔记:Vivado 2019.1 工程创建