当前位置:网站首页>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 3 [sampling and voxelization]
- Common shortcut keys of Jupiter notebook (you can also view it by pressing h in command mode)
- 力扣每日一题刷题总结:字符串篇(持续更新)
- Constant pointer and pointer constant
- OpenCV常用方法出处链接(持续更新)
- E-R画图明确内容
- 浅谈深度学习中的对抗样本及其生成方法
- Simply test the two different data transmission methods of content length and chunked
- install. IMG production method
猜你喜欢

Several methods of image enhancement and matlab code

针对tqdm和print的顺序问题

应对长尾分布的目标检测 -- Balanced Group Softmax

Use of opencv3 6.2 low pass filter

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

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

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

Replace convolution with full connection layer -- repmlp

Graph Pooling 简析

Opencv3 6.3 reduced pixel sampling with filters
随机推荐
Nacos service registration in the interface
Several methods of image enhancement and matlab code
Specification for package drawing
针对语义分割的真实世界的对抗样本攻击
乐理基础(简述)
Global and Chinese market of recovery equipment 2022-2028: Research Report on technology, participants, trends, market size and share
Fundamentals of music theory (brief introduction)
Gensim如何冻结某些词向量进行增量训练
How to wrap qstring strings
SQL server如何卸载干净
High school mathematics compulsory one
Eklavya -- infer the parameters of functions in binary files using neural network
用全连接层替代掉卷积 -- RepMLP
解决jetson nano安装onnx错误(ERROR: Failed building wheel for onnx)总结
Carsim-实时仿真的动画同步问题
Carsim problem failed to start Solver: Path Id Obj (X) was set to y; Aucune valeur de correction de xxxxx?
利用Transformer来进行目标检测和语义分割
Jupyter Notebook常用快捷键(在命令模式中按H也可查看)
【MnasNet】《MnasNet:Platform-Aware Neural Architecture Search for Mobile》
Sequence problem for tqdm and print