Medium Accuracy: 42.98% Submissions: 21870 Points: 4
Given a collection of Intervals,merge all the overlapping Intervals.
Given [1,3], [2,6], [8,10], [15,18],
return [1,6], [8,10], [15,18].
Make sure the returned intervals are sorted.
The first line contains an integer T, depicting total number of test cases.
Then following T lines contains an integer N depicting the number of Intervals and next line followed by the intervals starting and ending positions 'x' and 'y' respectively.
Print the intervals after overlapping in sorted manner. There should be a newline at the end of output of every test case.