当前位置:网站首页>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;
}边栏推荐
- GFS分布式文件系统
- Rasa 3. X learning series -rasa 3.2.1 new release
- Latex multiple linebreaks
- [gym 102832h] [template] combination lock (bipartite game)
- GFS distributed file system
- 【LeetCode】5. Valid Palindrome·有效回文
- 用列錶初始化你的vector&&initializer_list簡介
- How to improve eloquence
- Redis高可用——主从复制、哨兵模式、集群
- Idea connects to MySQL, and it is convenient to paste the URL of the configuration file directly
猜你喜欢

MySQL replace primary key delete primary key add primary key

18. (ArcGIS API for JS) ArcGIS API for JS point collection (sketchviewmodel)

China Jinmao online electronic signature, accelerating the digitization of real estate business

Tips for using pads router

传输层协议------UDP协议

云呐|固定资产管理系统主要操作流程有哪些

云呐|公司固定资产管理系统有哪些?

MySQL delete uniqueness constraint unique

云呐|固定资产管理系统功能包括哪些?

Part III Verilog enterprise real topic of "Niuke brush Verilog"
随机推荐
PV静态创建和动态创建
总结了 800多个 Kubectl 别名,再也不怕记不住命令了!
Bao Yan notebook IV software engineering and calculation volume II (Chapter 8-12)
Rasa 3. X learning series -rasa x Community Edition (Free Edition) changes
多普勒效应(多普勒频移)
【LeetCode】5. Valid palindrome
Redis high availability - master-slave replication, sentinel mode, cluster
C reflection and type
Fiddler Everywhere 3.2.1 Crack
20220703 week race: number of people who know the secret - dynamic rules (problem solution)
Redis高可用——主从复制、哨兵模式、集群
14 MySQL view
微信小程序---WXML 模板语法(附带笔记文档)
Switching power supply buck circuit CCM and DCM working mode
XML configuration file (DTD detailed explanation)
Rasa 3.x 学习系列-Rasa 3.2.1 新版本发布
Rasa 3.x 学习系列-Rasa X 社区版(免费版) 更改
Comparison of parameters between TVs tube and zener diode
保研笔记二 软件工程与计算卷二(13-16章)
Tips for using pads router