当前位置:网站首页>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;
}
边栏推荐
- Bao Yan notebook IV software engineering and calculation volume II (Chapter 8-12)
- 18. (ArcGIS API for JS) ArcGIS API for JS point collection (sketchviewmodel)
- [SQL] SQL expansion languages of mainstream databases (T-SQL, pl/sql, pl/pgsql)
- Online yaml to CSV tool
- 用列表初始化你的vector&&initializer_list简介
- QCombox(重写)+QCompleter(自动补全,自动加载qcombox的下拉选项,设置背景颜色)
- Qt 一个简单的word文档编辑器
- 保研笔记二 软件工程与计算卷二(13-16章)
- When to use useImperativeHandle, useLayoutEffect, and useDebugValue
- orgchart. JS organization chart, presenting structural data in an elegant way
猜你喜欢
Biased sample variance, unbiased sample variance
orgchart. JS organization chart, presenting structural data in an elegant way
总结了 800多个 Kubectl 别名,再也不怕记不住命令了!
QT QPushButton details
18.(arcgis api for js篇)arcgis api for js点采集(SketchViewModel)
698. Divided into k equal subsets ●●
Switching power supply buck circuit CCM and DCM working mode
Miaochai Weekly - 8
Spire Office 7.5.4 for NET
Fiddler Everywhere 3.2.1 Crack
随机推荐
Redis high availability - master-slave replication, sentinel mode, cluster
CloudCompare&PCL 点云随机添加噪声
【EF Core】EF Core与C# 数据类型映射关系
GFS分布式文件系统
After summarizing more than 800 kubectl aliases, I'm no longer afraid that I can't remember commands!
教你在HbuilderX上使用模拟器运行uni-app,良心教学!!!
Idea connects to MySQL, and it is convenient to paste the URL of the configuration file directly
Effet Doppler (déplacement de fréquence Doppler)
Do you regret becoming a programmer?
Open3D 点云随机添加噪声
How to rotate the synchronized / refreshed icon (EL icon refresh)
Breadth first search open turntable lock
How to improve eloquence
哪些偏门项目可以做到?自媒体做到月赚一万以上很难吗?
跟着CTF-wiki学pwn——ret2libc1
The use of El cascader and the solution of error reporting
Convert Chinese into pinyin
el-cascader的使用以及报错解决
Initialiser votre vecteur & initialisateur avec une liste Introduction à la Liste
第16章 OAuth2AuthorizationRequestRedirectWebFilter源码解析