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
🐳More Google problems
- Longest Subarray with Sum at Most KOA · Seen Jul 2026
- Count Prefix Matches in a Sorted ArrayONSITE INTERVIEW · Seen Jul 2026
- Decode StringONSITE INTERVIEW · Seen Jul 2026
- Phone Keypad Letter CombinationsONSITE INTERVIEW · Seen Jul 2026
- Split a Log Outside QuotesONSITE INTERVIEW · Seen Jul 2026
- Ad Score Scheduler With DelayONSITE INTERVIEW · Seen Jul 2026
- Alternating-Color Binary Tree RootsONSITE INTERVIEW · Seen Jul 2026
- Route Pattern MatcherONSITE INTERVIEW · Seen Jul 2026