当前位置:网站首页>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); */
边栏推荐
- Circular queue related design and implementation reference 1
- Programming ideas are more important than anything, not more than who can use several functions, but more than the understanding of the program
- LeetCode - 508. 出现次数最多的子树元素和 (二叉树的遍历)
- Tensorflow built-in evaluation
- Toolbutton property settings
- Open Euler Kernel Technology Sharing - Issue 1 - kdump Basic Principles, use and Case Introduction
- Pymssql controls SQL for Chinese queries
- Embedded systems are inherently flawed. Compared with the Internet, there are so many holes that it is simply difficult to walk away from
- Crash工具基本使用及实战分享
- ADS simulation design of class AB RF power amplifier
猜你喜欢

Windows下MySQL的安装和删除

openEuler kernel 技术分享 - 第1期 - kdump 基本原理、使用及案例介绍

学习开发没有捷径,也几乎不存在带路会学的快一些的情况

I think all friends should know that the basic law of learning is: from easy to difficult

Mobile phones are a kind of MCU, but the hardware it uses is not 51 chip

单片机现在可谓是铺天盖地,种类繁多,让开发者们应接不暇

When you need to use some functions of STM32, but 51 can't realize them, 32 naturally doesn't need to learn

QT is a method of batch modifying the style of a certain type of control after naming the control

Oracle database SQL statement execution plan, statement tracking and optimization instance

单片机学到什么程度能找到工作,这个标准不好量化
随机推荐
openEuler kernel 技術分享 - 第1期 - kdump 基本原理、使用及案例介紹
4G module board level control interface designed by charging pile
STM32 interrupt switch
Seven sorting of ten thousand words by hand (code + dynamic diagram demonstration)
Serial port programming
嵌入式本来就很坑,相对于互联网来说那个坑多得简直是难走
Window maximum and minimum settings
When the reference is assigned to auto
Application of 51 single chip microcomputer timer
On the problem of reference assignment to reference
STM32 general timer 1s delay to realize LED flashing
01 business structure of imitation station B project
Dynamic layout management
I didn't think so much when I was in the field of single chip microcomputer. I just wanted to earn money to support myself first
(1) 什么是Lambda表达式
The underlying principle of vector
应用最广泛的8位单片机当然也是初学者们最容易上手学习的单片机
单片机学到什么程度能找到工作,这个标准不好量化
Retinaface: single stage dense face localization in the wild
01仿B站项目业务架构