Problem · Intervals
Merge Intervals with Names
Learn this problemProblem statement
This is like merge interval question but the result needs to have a list of names in the interval too. The OP mentioned that they did not quite sure how the list of names is done...And neither am I..😱
Function
mergeIntervalsWithNames(intervals: String[][]) → String[]Examples
Example 1
intervals = [["Foo", "10", "30"], ["Bar", "15", "45"]]return = ["10 15 Foo", "15 30 Foo, Bar", "30 45 Bar"]🐠
Constraints
🐳