当前位置:网站首页>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 .
边栏推荐
- Open3d learning note 5 [rgbd fusion]
- AR system summary harvest
- Specification for package drawing
- Simply test the two different data transmission methods of content length and chunked
- How to back up the configuration before the idea when reinstalling the idea
- 使用Matplotlib绘制图表初步
- Longest isometric subsequence
- Global and Chinese market of snow sweepers 2022-2028: Research Report on technology, participants, trends, market size and share
- 将恶意软件嵌入到神经网络中
- Daily practice (19): print binary tree from top to bottom
猜你喜欢

包图画法注意规范

OpenCV 6.4 中值滤波器的使用

OpenCV3 6.3 用滤波器进行缩减像素采样

【学习笔记】反向误差传播之数值微分

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

EKLAVYA -- 利用神经网络推断二进制文件中函数的参数

Hystrix dashboard cannot find hystrix Stream solution

OpenCV3 6.2 低通滤波器的使用

Carsim-路面3D形状文件参数介绍

CarSim problem failed to start solver: path_ ID_ OBJ(X) was set to Y; no corresponding value of XXXXX?
随机推荐
静态库和动态库
Carsim-問題Failed to start Solver: PATH_ID_OBJ(X) was set to Y; no corresponding value of XXXXX?
How to back up the configuration before the idea when reinstalling the idea
On November 24, we celebrate the "full moon"
包图画法注意规范
利用Transformer来进行目标检测和语义分割
Graph Pooling 简析
OpenCV关于x,y坐标容易混淆的心得
How to wrap qstring strings
Use of OpenCV 6.4 median filter
浅谈深度学习模型中的后门
最长等比子序列
Open3d learning note 5 [rgbd fusion]
Animation synchronization of CarSim real-time simulation
联邦学习下的数据逆向攻击 -- GradInversion
Income in the first month of naked resignation
AR系统总结收获
使用C#语言来进行json串的接收
On the confrontation samples and their generation methods in deep learning
力扣方法总结:查找类