Non-overlapping intervals
Removing the fewest intervals is the same as keeping the most, which is N meetings in one room again: sort by end and keep an interval when it starts at or after the last kept one's end. When two overlap, the one that ends later goes, since the earlier end leaves more room.
Here intervals that only touch, like [1, 2] and [2, 3], don't overlap. The dashed lines are lastEnd and the checked interval's start. removed lists the intervals taken out; the answer is how many.