当前位置:网站首页>Force deduction method summary: find classes
Force deduction method summary: find classes
2022-07-02 08:09:00 【Villanelle#】
436. Look for the right range Medium lower_bound Method 2021/11/10
Give you an interval array intervals , among intervals[i] = [starti, endi] , And each starti all Different .
Section i Of Right section It can be recorded as an interval j , And satisfy startj >= endi , And startj To minimize the .
Returns an interval consisting of each interval i Of Right section stay intervals An array of corresponding subscripts in . If a certain interval i There is no corresponding Right section , Then subscript i The value at is set to -1 .
Example :
Input :intervals = [[3,4],[2,3],[1,2]]
Output :[-1,0,1]
explain : about [3,4] , There is no such thing as “ On the right side ” Section .
about [2,3] , Section [3,4] Have the smallest “ Right ” The starting point ;
about [1,2] , Section [2,3] Have the smallest “ Right ” The starting point .
utilize map Press... Automatically when the container is inserted key Nature of sorting , Use map Container storage intervals The left interval value and the corresponding subscript in , When traversing each interval , Use map In container lower_bound How to find key In the first >= Iterator of its right interval value , Its second Value is its subscript .
边栏推荐
- Use of opencv3 6.2 low pass filter
- Sqlyog remote connection to MySQL database under centos7 system
- CarSim problem failed to start solver: path_ ID_ OBJ(X) was set to Y; no corresponding value of XXXXX?
- Brief introduction of prompt paradigm
- Data reverse attack under federated learning -- gradinversion
- Global and Chinese market of snow sweepers 2022-2028: Research Report on technology, participants, trends, market size and share
- 利用Transformer来进行目标检测和语义分割
- Carsim problem failed to start Solver: Path Id Obj (X) was set to y; Aucune valeur de correction de xxxxx?
- 用C# 语言实现MYSQL 真分页
- Embedding malware into neural networks
猜你喜欢

使用Matplotlib绘制图表初步

OpenCV 6.4 中值滤波器的使用

利用超球嵌入来增强对抗训练

On the confrontation samples and their generation methods in deep learning
![Open3d learning note 4 [surface reconstruction]](/img/9d/c1c3f2f3d4acd74a2c043571a120b3.png)
Open3d learning note 4 [surface reconstruction]

C语言实现XML生成解析库(XML扩展)

使用C#语言来进行json串的接收

Introduction to parameters of CarSim pavement 3D shape file

Embedding malware into neural networks

Matlab数学建模工具
随机推荐
Hystrix dashboard cannot find hystrix Stream solution
服务器的内网可以访问,外网却不能访问的问题
CVPR19-Deep Stacked Hierarchical Multi-patch Network for Image Deblurring论文复现
力扣方法总结:查找类
Jetson nano installation tensorflow stepping pit record (scipy1.4.1)
Using transformer for object detection and semantic segmentation
MySQL优化
[learning notes] numerical differentiation of back error propagation
Get the width and height of the screen in real time (adaptive)
Open3d learning notes II [file reading and writing]
Business architecture diagram
Library function of C language
Global and Chinese markets for Salmonella typhi nucleic acid detection kits 2022-2028: Research Report on technology, participants, trends, market size and share
Vscode下中文乱码问题
Find and rfind methods in string
install. IMG production method
Open3d learning notes 1 [first glimpse, file reading]
学习写文章格式
Income in the first month of naked resignation
A brief analysis of graph pooling