 All Problems
Non-overlapping Intervals
medium
arrays
greedy
sorting
google
amazon
facebook
microsoft

Given an array of intervals, return the minimum number of intervals you need to remove to make the rest non-overlapping.

Example 1:

Input:
4
1 2
2 3
3 4
1 3
Output: 1

Input format: Line 1 = n. Next n lines = start end.

Run to check your code against the sample cases, or submit to run every case