当前位置:网站首页>牛客-TOP101-BM42
牛客-TOP101-BM42
2022-07-30 11:13:00 【一条吃猫的鱼】
import java.util.*;
import java.util.Stack;
public class Solution {
Stack<Integer> stack1 = new Stack<Integer>();
Stack<Integer> stack2 = new Stack<Integer>();
public void push(int node) {
stack1.push(node);
}
public int pop() {
while(!stack1.isEmpty()){
stack2.push(stack1.pop());
}
int num = stack2.pop();
while(!stack2.isEmpty()){
stack1.push(stack2.pop());
}
return num;
}
}
边栏推荐
- 单片机开发之LCD1602显示实验
- The package of idea is not hollow
- Current relay JL-8GB/11/AC220V
- 高手云集、丰富活动,斩获佳绩,超过2万名开发者参与的AI社团邀你加入!
- 湖仓一体电商项目(一):项目背景和架构介绍
- Neural Network Study Notes 4 - Autoencoder (including sparse, stacked) (updated)
- 【JZ64 求1+2+3+...+n】
- 【 HMS core 】 【 Analytics Kit] [FAQ] how to solve the payment amount in huawei pay analysis shows zero problem?
- 【Flume】batchSize和transactionCapacity区别
- 类和对象—6个默认成员函数
猜你喜欢
随机推荐
API 网关 APISIX 在Google Cloud T2A 和 T2D 的性能测试
美团内推+校招笔试题+知识点总结
NLP领域的最新研究进展
我又造了个轮子:GrpcGateway
简述controller,service,repository注解的用法(谈谈application.properties的作用)
【云原生】-Docker安装部署分布式数据库 OceanBase
ABP学习资源整理
VLAN实验
神经网络学习笔记3——LSTM长短期记忆网络
张量篇-初步
编译Hudi
Scrapy crawler website image crawling
【ASP.NET Core】选项类的依赖注入
湖仓一体电商项目(一):项目背景和架构介绍
Vim plugin GrepIt
Drag and drop events, dataTransfer, getBoundingClientRect
XYplorer 23多语言,最好的管理软件之一
高能产出!腾讯内部的MyCat中间件手册,理论实操齐下
360 released a future-oriented EDR to protect the security of government and enterprise user terminals in an all-round way
Typroa 替代工具marktext









