[Discuss] MERGE INTERVALS

Hey folks,
Let’s discuss anything related to the MERGE INTERVALS problem in this thread.

edge-test-2 Can’t find the case it stucks on ?

1 Like

Could not find main class MergeIntervals erro while debugging

Are the inputted interval always in given fashion sorted.
Or their ordering can be random.

For example - is [4,5], [1,3] a valid input?
@gouravsardana

1 Like

Is the input given in sorted order?

are we expected to merge multiple intervals

example
INPUT:[1,2], [1,3],[1,4], [1,5],[12,16], OUTPUT: [1,5], [12,16] ??

since the first 4 elements are merged

when dealing with equality
say
for INPUT:[1,2], [2,3] answer will be [1,3]
or [1,2], [2,3] ??

Yeah @aungrah equals can be merged: Here answer would be: [1, 3]

Yeah this is correct to

hey you figured out the case?

is there a case when the input interval is reversed i mean , {a,b} and a>b?
and can there be two same intervals?

What is the expected time complexity of Module 2? My O(nlogn) code is failing perf-test-6.
EDIT: Found the issue, Arrays.sort isn’t O(nlogn) in java7.

Yes if you can do it in O(nlogn)

Yes, a case can be for two same intervals where start or end is same.

yes anyways my code is handling that

Did you get passed? I am getting TLE for prfm-6 test case

My edge cases are passing but perf test cases are failing. What could be the reason for that?

Hey, anyone figured what is edge-test-2 case?

my edge case 2 is not passing

hey anyone get link for attendance in codeblitz?