Loading...
Given intervals [start, end], return the minimum number of intervals to remove to make the rest non-overlapping.
Input: intervals as start:end comma-separated.
1:2,2:3,3:4,1:3
1
[1,2], [2,3], [3,4], and [1,3], which can be sorted by their end values as [1,2], [2,3], [3,4], and [1,3].[1,3] overlaps with [1,2] and [2,3], but if we remove [1,3], the remaining intervals are non-overlapping.[1,3] makes the rest non-overlapping.