You are given a intervals, where intervals[i] = [start_i, end_i] represents the start and end points of the k.
A collection of intervals can be partitioned into connected groups where any two intervals that overlap or touch at their endpoints belong to the same group.
You can insert one new interval of length k, represented as [x, x + k] for any integer x, into intervals.
Return the minimum number of connected groups obtained after inserting the new interval.
Constraints:
intervals.length
intervals[i] == [start_i, end_i]
start_i end_i
k
You are given a intervals, where intervals[i] = [start_i, end_i] represents the start and end points of the k.
A collection of intervals can be partitioned into connected groups where any two intervals that overlap or touch at their endpoints belong to the same group.
You can insert one new interval of length k, represented as [x, x + k] for any integer x, into intervals.
Return the minimum number of connected groups obtained after inserting the new interval.
Constraints:
intervals.length
intervals[i] == [start_i, end_i]
start_i end_i
k