当前位置:网站首页>牛客-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;
}
}
边栏推荐
- 久经沙场的程序员居然也被某鱼的假程序员骗了,程序员之间的信任应该是最高的,他一个人毁了这种信任感
- Transfer Learning技术研修
- 360 released a future-oriented EDR to protect the security of government and enterprise user terminals in an all-round way
- Swift 常用扩展类和简单封装
- log4js入门
- Security tip: FreeType in Qt
- PL5920 SOT-23-6 21V、2A、600KHz同步降压DC/DC转换器
- Introduction to IoT Technologies: Chapter 6
- oracle export dmp file type as "crash dump file"
- ODrive应用 #4 配置参数&指令「建议收藏」
猜你喜欢

FPGA刷题——计数器(简易秒表、可置位计数器、加减计数器)

TestNg整合Retry代码

STM32F1读取MLX90632非接触式红外温度传感器

GBJ2510-ASEMI电机专用25A整流桥GBJ2510

AB test summary

高手云集、丰富活动,斩获佳绩,超过2万名开发者参与的AI社团邀你加入!
![[ASP.NET Core] Dependency Injection for Option Classes](/img/3f/820b6e33897cf385c3206c02d741f8.png)
[ASP.NET Core] Dependency Injection for Option Classes

零代码开发入门:快速上手DIY函数公式的5个步骤

易基因:人类tRNA基因位点表现出与衰老相关的DNA高甲基化|研究文章

PL5920 SOT-23-6 21V、2A、600KHz同步降压DC/DC转换器
随机推荐
ODrive应用 #4 配置参数&指令「建议收藏」
Easy gene: human tRNA gene loci showed age-related high DNA methylation | research articles
原生js 创建表格
电压继电器HDY-A/1-220VAC-1
PL5920 SOT-23-6 21V、2A、600KHz同步降压DC/DC转换器
208. 实现 Trie (前缀树)
实现web实时消息推送的7种方案
分布式限流 redission RRateLimiter 的使用及原理
久经沙场的程序员居然也被某鱼的假程序员骗了,程序员之间的信任应该是最高的,他一个人毁了这种信任感
单片机开发之LCD1602显示实验
Beyond Stream Processing !第四届实时计算 Flink 挑战赛启动,49 万奖金等你来拿!
XYplorer 23多语言,最好的管理软件之一
数据库性能系列之索引(上)
SQL language and paging rownum analysis in Oracle
单片机开发之静态LED显示
2022全球数字经济大会人工智能专场:AI安全受高度关注
High energy output!Tencent's internal MyCat middleware manual, both theoretical and practical
idea的package没有空心
Static LED display developed by single chip microcomputer
神经网络学习笔记3——LSTM长短期记忆网络