757. Set Intersection Size At Least Two
757. Set Intersection Size At Least Two
Description
Solution
Refer to 452 452. Minimum Number of Arrows to Burst Balloons. These two questions are very similar.
We need to greedily find the maximum non-overlapping intervals.
And the template should always sort the intervals by endpoints and see if we could pick elements greedily to fit the requirement.
Code
1 | class Solution { |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.