Divide Intervals Into Minimum Number of Groups
Medium · Intervals · about 15 minutes
Asked at Google, Amazon, Microsoft, Meta.
intervals[i] = [left, right] is an inclusive interval. Divide them into groups so no two intervals in a group intersect (sharing an endpoint counts as intersecting). Return the minimum number of groups.