当前位置:网站首页>Niuke-TOP101-BM42
Niuke-TOP101-BM42
2022-07-30 11:41:00 【a cat-eating fish】
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;
}
}
边栏推荐
猜你喜欢

活动速递| Apache Doris 性能优化实战系列直播课程初公开,诚邀您来参加!

基于.NetCore开发博客项目 StarBlog - (16) 一些新功能 (监控/统计/配置/初始化)

idea的package没有空心

2022-07-29 Gu Yujia Study Notes Exception Handling

Interviewer: Redis bloom filter and the cuckoo in the filter, how much do you know?

Microsoft SQL server hacked, bandwidth stolen

Manage reading notes upward

2022-07-29 顾宇佳 学习笔记 异常处理

Voltage relay HDY - vac - 1 A / 1-220

HJY-F931A/YJ three-phase voltage relay
随机推荐
程序环境和预处理(详解)
Taobao/Tmall taobao comments q&a list interface API
Difference between C# enumeration type and xaml
时间序列曲线相似性
Manage reading notes upward
NLP领域的最新研究进展
Scheduling of combined electric-heating system based on multi-objective two-stage stochastic programming method
VLAN相关知识点
Voltage relay h2d SRMUVS - 100 vac - 2
VLAN实验
Verilog grammar basics HDL Bits training 07
GBJ2510-ASEMI电机专用25A整流桥GBJ2510
Swift common extension classes and simple encapsulation
pg_rewind 修复主备环境的时间线
STM32F1 reads MLX90632 non-contact infrared temperature sensor
208. 实现 Trie (前缀树)
Assembly to implement bubble sort
活动速递| Apache Doris 性能优化实战系列直播课程初公开,诚邀您来参加!
电压继电器HDY-A/1-220VAC-1
contentDocument contentWindow,canvas 、svg,iframe