Question: Merge nodes Given an array of nums where nums [ i ] = [ xi , yi ) , unify all connecting numbers, and return

Merge nodes Given an array of nums where nums[i]=[xi, yi), unify all connecting numbers, and return an array of the non-connecting numbers that cross all the numbers in the given input. Example 1: Input: nums=[[2,6],[8,10],[1,3],[15,18]] Output: [[1,6],[8,10],[15,18]] Explanation: Since points [1,3] and [2.6) cross, unify them into [1,6]. Example 2: Input: nums =[[1.4],[4,5]] Output: [[1.5]] Explanation: nums [1,4] and [4,5] are considered crossing. Constraints: 1<= nums.length <=104 nums[i].length ==20<= xi <= yi <=104

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!