当前位置:网站首页>Leetcode - 933 number of recent requests
Leetcode - 933 number of recent requests
2022-07-03 10:05:00 【Cute at the age of three @d】
deque
class RecentCounter {
private Deque<Integer> deque;
public RecentCounter() {
deque = new LinkedList<>();
}
public int ping(int t) {
deque.offerLast(t);
while(deque.size()!= 0 && t - 3000 > deque.peekFirst())
deque.pollFirst();
return deque.size();
}
}
/** * Your RecentCounter object will be instantiated and called as such: * RecentCounter obj = new RecentCounter(); * int param_1 = obj.ping(t); */
边栏推荐
- 手机都算是单片机的一种,只不过它用的硬件不是51的芯片
- My notes on the development of intelligent charging pile (III): overview of the overall design of the system software
- The data read by pandas is saved to the MySQL database
- 2.Elment Ui 日期选择器 格式化问题
- 学历是一张通行证,门票,你有了它,可以踏入更高层次的环境里
- Retinaface: single stage dense face localization in the wild
- Getting started with JMX, MBean, mxbean, mbeanserver
- STM32 interrupt switch
- Wireshark use
- 学习开发没有捷径,也几乎不存在带路会学的快一些的情况
猜你喜欢
Dictionary tree prefix tree trie
It is difficult to quantify the extent to which a single-chip computer can find a job
单片机学到什么程度能找到工作,这个标准不好量化
LeetCode - 460 LFU 缓存(设计 - 哈希表+双向链表 哈希表+平衡二叉树(TreeSet))*
新系列单片机还延续了STM32产品家族的低电压和节能两大优势
openEuler kernel 技术分享 - 第1期 - kdump 基本原理、使用及案例介绍
干单片机这一行的时候根本没想过这么多,只想着先挣钱养活自己
Pymssql controls SQL for Chinese queries
Seven sorting of ten thousand words by hand (code + dynamic diagram demonstration)
There is no shortcut to learning and development, and there is almost no situation that you can learn faster by leading the way
随机推荐
01仿B站项目业务架构
2020-08-23
Tensorflow built-in evaluation
My notes on the development of intelligent charging pile (III): overview of the overall design of the system software
没有多少人能够最终把自己的兴趣带到大学毕业上
MySQL root user needs sudo login
01 business structure of imitation station B project
Positive and negative sample division and architecture understanding in image classification and target detection
Crash工具基本使用及实战分享
There is no specific definition of embedded system
There is no shortcut to learning and development, and there is almost no situation that you can learn faster by leading the way
编程思想比任何都重要,不是比谁多会用几个函数而是比程序的理解
Screen display of charging pile design -- led driver ta6932
YOLO_ V1 summary
(1) What is a lambda expression
学习开发没有捷径,也几乎不存在带路会学的快一些的情况
Timer and counter of 51 single chip microcomputer
Drive and control program of Dianchuan charging board for charging pile design
一个可执行的二进制文件包含的不仅仅是机器指令
Not many people can finally bring their interests to college graduation