当前位置:网站首页>2022.7.5-----leetcode.729
2022.7.5-----leetcode.729
2022-07-05 23:50:00 【路Lu727】
List<int[]> booked;//已预定区间
public MyCalendar() {
booked = new ArrayList<int[]>();
}
public boolean book(int start, int end) {
for (int[] arr : booked) {
int l = arr[0], r = arr[1];
//对于每个区间,判断是否会重叠
if ( start < r&&end> l ) {
return false;
}
}
booked.add(new int[]{start, end});
return true;
}边栏推荐
- Which side projects can be achieved? Is it difficult for we media to earn more than 10000 a month?
- Latex multiple linebreaks
- Spire Office 7.5.4 for NET
- After summarizing more than 800 kubectl aliases, I'm no longer afraid that I can't remember commands!
- 14 MySQL-视图
- Tips for using pads router
- PV static creation and dynamic creation
- Miaochai Weekly - 8
- QT a simple word document editor
- How to rotate the synchronized / refreshed icon (EL icon refresh)
猜你喜欢

Spire Office 7.5.4 for NET

PADS ROUTER 使用技巧小记

多普勒效應(多普勒頻移)
![[day39 literature extensive reading] a Bayesian perspective on magnetic estimation](/img/9c/438ef820a9f703c21f708bfc1dbbc4.jpg)
[day39 literature extensive reading] a Bayesian perspective on magnetic estimation

Initialize your vector & initializer with a list_ List introduction

Breadth first search open turntable lock

4 points tell you the advantages of the combination of real-time chat and chat robots

C# 反射与Type

My colleagues quietly told me that flying Book notification can still play like this

After summarizing more than 800 kubectl aliases, I'm no longer afraid that I can't remember commands!
随机推荐
保研笔记一 软件工程与计算卷二(1-7章)
14 MySQL-视图
Redis high availability - master-slave replication, sentinel mode, cluster
QT--线程
Différence entre hors bande et en bande
Effet Doppler (déplacement de fréquence Doppler)
Redis高可用——主从复制、哨兵模式、集群
数据库遇到的问题
Breadth first search open turntable lock
4 points tell you the advantages of the combination of real-time chat and chat robots
Use CAS instead of synchronized
Senparc. Weixin. Sample. MP source code analysis
How to rotate the synchronized / refreshed icon (EL icon refresh)
Spire Office 7.5.4 for NET
【luogu CF487E】Tourists(圆方树)(树链剖分)(线段树)
21.PWM应用编程
Rasa 3.x 学习系列-Rasa 3.2.1 新版本发布
传输层协议------UDP协议
STM32__06—单通道ADC
Spire. PDF for NET 8.7.2