Interval Problems

**Top Questions**

Name | Example |
---|---|

Two ways to check whether two intervals overlap | min(y1, y2) > max(x1, x2); x1<y2 && x2>y1 |

Two types of intervals | `[x, y]` vs `[x, y)` |

Interval problems usually solved by heap or greedy algorithms | LeetCode: Car Pooling |

General idea of overlapping interval problems | Sort intervals, maintain an active set, loop each intervals |

Sort by point_{x} is common. But sometimes need to sort by point_{y} |
LeetCode: Minimum Number of Arrows to Burst Balloons |

Typical problems: Interval conflict – Detect double booking | LeetCode: My Calendar I |

Typical problems: Interval conflict – Detect triple booking | LeetCode: My Calendar II |

Typical problems: Interval conflict – Detect K booking | LeetCode: My Calendar III, LeetCode: Car Pooling |

Typical problems: Interval List Intersections | LeetCode: Interval List Intersections |

Typical problems: Interval List Union | LeetCode: Insert Interval |

See all interval problems: #interval

- Review: Interval Problems
- LintCode: Time Intersection
- LintCode: Interval Search
- LintCode: Digital Coverage
- LeetCode: Teemo Attacking
- LeetCode: Smallest Range II
- LeetCode: Smallest Range I
- LeetCode: Non-overlapping Intervals
- LeetCode: My Calendar III
- LeetCode: My Calendar II
- LeetCode: My Calendar I
- LeetCode: Missing Ranges
- LeetCode: Minimum Number of Arrows to Burst Balloons
- LeetCode: Merge Intervals
- LeetCode: Meeting Rooms
- LeetCode: Insert Interval
- LeetCode: Find Right Interval
- LeetCode: Employee Free Time

See more blog posts.