← All problemsSign in

Overlapping Intervals

You are given few sets of intervals print out the entire intervals without overlapping, if they overlap then combine them into one. Input First line N Next N lines contains two integers which represents intervals separated by spaces. Output Each line containing intervals without overlapping. Constraints - 2 ≤ N ≤ 100 Example 1: Input: 5 5 7 1 6 2 4 10 14 8 9 Output: 1 7 8 9 10 14 Exp

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start