Interval问题
题目
Merge/Insert Interval:如果题目问的和overlapp有关,那么我们还是要通过sweepline做最好,因为merge interval之后overlapping信息就丢失了。但是如果题目问的是找空闲时间段,那么merge interval就够用了,因为merge之后的间隔都是空闲
sweepline: 求和overlapping或者non-overlapping有关的问题
- Given a lot of logs: log(startTime, endTime, memoryUse), return the peak memory usage. (谷歌onsite)
- Leetcode 223. Rectangle Area
range addition: 本质上还是借助了括号匹配的思想 Leetcode 370. Range Addition