Disjoint Intervals
CodeChefOpen on judge ↗
Chef has assigned you a new job. You have to complete this job in order to earn his respect. Chef has given you few intervals and you have to return disjoint intervals after merging all the overlapping intervals. ### Input The first input line has an integer $N$: the number of intervals. After this, there are n lines that describe the ranges. Each line has two integers $x$ and $y$ : the range
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start