


Input: 'INTERVALS' = [[1, 2], [1, 3], [2, 3], [3, 4]]
Output: 1
After rescheduling the worker with the interval [1, 3] it is possible to get the non-overlapping working times.
The first line of input contains an integer 'T', denoting the number of test cases.
The first line contains an integer 'N' size of the list 'intervals' next 'N' lines will contain two integers, each start and end time for each worker.
For each test case, print the minimum number of workers needed to reschedule their work time so as there are non-overlapping working times in any two workers.
Output for each test case will be printed in a separate line.
You don't need to print anything. It has already been taken care of. Just implement the given function.
1 <= ‘T’ <= 10
1 <= 'N' <= 10^4
'INTERVALS[i].LENGTH' == 2
'INTERVALS[i][0]' < 'INTERVALS[i][1]'
'INTERVALS[i][j]' <= 10^9
Time Limit: 1sec
We can easily achieve this by sorting the intervals by their ending position and then greedily incrementing the counter according to the number of overlaps.
Algorithm :