当前位置:网站首页>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 .
边栏推荐
- Command line is too long
- Open3d learning note 4 [surface reconstruction]
- Several methods of image enhancement and matlab code
- 浅谈深度学习中的对抗样本及其生成方法
- 最长等比子序列
- Remplacer l'auto - attention par MLP
- Carla-UE4Editor导入RoadRunner地图文件(保姆级教程)
- Eklavya -- infer the parameters of functions in binary files using neural network
- Open3D学习笔记一【初窥门径,文件读取】
- 力扣每日一题刷题总结:链表篇(持续更新)
猜你喜欢

Target detection for long tail distribution -- balanced group softmax

图像增强的几个方法以及Matlab代码

Remplacer l'auto - attention par MLP

VS Code配置问题

Dynamic extensible representation for category incremental learning -- der

Real world anti sample attack against semantic segmentation

包图画法注意规范

STM32疑难杂症之ST-LINK Connection error INVALID ROM TABLE

Principes fondamentaux de la théorie musicale (brève introduction)

【MnasNet】《MnasNet:Platform-Aware Neural Architecture Search for Mobile》
随机推荐
My VIM profile
Media query usage
Global and Chinese market of snow sweepers 2022-2028: Research Report on technology, participants, trends, market size and share
Summary of open3d environment errors
浅谈深度学习中的对抗样本及其生成方法
[learning notes] matlab self compiled image convolution function
常量指针和指针常量
[binocular vision] binocular stereo matching
【MobileNet V3】《Searching for MobileNetV3》
On the back door of deep learning model
Fundamentals of music theory (brief introduction)
Array and string processing, common status codes, differences between PHP and JS (JS)
Backup, recovery and repair of XFS file system
The internal network of the server can be accessed, but the external network cannot be accessed
High school mathematics compulsory one
【MagNet】《Progressive Semantic Segmentation》
AR系统总结收获
Meta learning Brief
Principes fondamentaux de la théorie musicale (brève introduction)
C # connect to MySQL database