You are given a intervals where intervals[i] = [left_i, right_i] represents the inclusive interval from left_i to right_i.
You want to divide the intervals into one or more groups such that every interval belongs to exactly one group, and no two intervals in the same group intersect each other.
Return the minimum number of groups needed.
Note: Two intervals intersect if there is at least one common point between them. For instance, the intervals
[1, 5]and[5, 10]intersect because they share the common point.
Constraints:
intervals.length
intervals[i].length
left_i right_i
You are given a intervals where intervals[i] = [left_i, right_i] represents the inclusive interval from left_i to right_i.
You want to divide the intervals into one or more groups such that every interval belongs to exactly one group, and no two intervals in the same group intersect each other.
Return the minimum number of groups needed.
Note: Two intervals intersect if there is at least one common point between them. For instance, the intervals
[1, 5]and[5, 10]intersect because they share the common point.
Constraints:
intervals.length
intervals[i].length
left_i right_i