type
status
date
slug
summary
tags
category
icon
password
这些是简单的 可以差不多了解一下做法
Maximum Population Year -> 1854
Points That Intersect With Cars -> 2848
Car Pooling -> 1094
My Calendar II -> 731
Shifting Letters II -> 2381
Perfect Rectangle -> 391
Rectangle Area II -> 850
Number of Flowers in Full Bloom -> 2251
这里的会更全面一点
2054. Two Best Non-Overlapping Events
56. Merge Intervals
很经典的题 下面的回头看
If this is an real world abstrcted problem, i'd prefer to use divide and conquer technique depends on the requirements. For example, partitioning input intervals based on interval start/end value, i.e we have 1000 buckets, inside each bucket we maintain a sorted intervals, each bucket can be in one machine or multiples buckets in one machine. then we use merge those bucket 2 by 2 until to the point each bucket contains maximum intervals. And make sure no intervals are across two buckets
For either endless incoming stream mentioned here or memory is too small to load all intervals, this approach should work.
this BST approach is impresive but not realistic for me to write in the interview
731. My Calendar II
2779. Maximum Beauty of an Array After Applying Operation
57. Insert Interval
这道题很麻烦 感觉用了最笨的方法
太离谱了 有几个testcase嗯是不知道怎么错的
1353. Maximum Number of Events That Can Be Attended
- Author:ran2323
- URL:https://www.blueif.me//article/15771a79-6e22-80b4-afb5-c52bbbca3713
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!