当前位置:网站首页>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;
}
边栏推荐
- CIS benchmark tool Kube bench
- Spreadjs 15.1 CN and spreadjs 15.1 en
- Part III Verilog enterprise real topic of "Niuke brush Verilog"
- Do you regret becoming a programmer?
- Use CAS instead of synchronized
- Initialiser votre vecteur & initialisateur avec une liste Introduction à la Liste
- Cwaitabletimer timer, used to create timer object access
- 传输层协议------UDP协议
- 单商户V4.4,初心未变,实力依旧!
- 第16章 OAuth2AuthorizationRequestRedirectWebFilter源码解析
猜你喜欢
Rasa 3. X learning series -rasa 3.2.1 new release
用列錶初始化你的vector&&initializer_list簡介
Spire. PDF for NET 8.7.2
Open source CRM customer relationship system management system source code, free sharing
18.(arcgis api for js篇)arcgis api for js点采集(SketchViewModel)
上门预约服务类的App功能详解
Dynamic planning: robbing families and houses
Zhongjun group launched electronic contracts to accelerate the digital development of real estate enterprises
rsync远程同步
GFS分布式文件系統
随机推荐
Senparc.Weixin.Sample.MP源码剖析
When to use useImperativeHandle, useLayoutEffect, and useDebugValue
Problem solving win10 quickly open ipynb file
98. Verify the binary search tree ●●
C # input how many cards are there in each of the four colors.
传输层协议------UDP协议
PADS ROUTER 使用技巧小记
20220703 week race: number of people who know the secret - dynamic rules (problem solution)
PV static creation and dynamic creation
Part III Verilog enterprise real topic of "Niuke brush Verilog"
CloudCompare&PCL 点云随机添加噪声
如何让同步/刷新的图标(el-icon-refresh)旋转起来
How to get all the values stored in localstorage
C# 反射与Type
rsync远程同步
TS type declaration
Online yaml to CSV tool
The use of El cascader and the solution of error reporting
Latex multiple linebreaks
XML配置文件(DTD详细讲解)