Merge Intervals with Names
Updated
Problem 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 Onsite Interview questions
- Route Pattern MatcherPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Evaluate a Nested Math ExpressionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Distinct Subset SumsONSITE INTERVIEW · Seen Nov 2026
- Playlist With No Same Artist in a RowONSITE INTERVIEW · Seen Nov 2026
- Delete Nodes and Return Forest RootsONSITE INTERVIEW · Seen Nov 2026
- Dice-Walk Winning ProbabilityPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- First and Last Target Position in a Mountain ArrayONSITE INTERVIEW · Seen Nov 2026
- Lowest Common Ancestor in an N-ary TreePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- 0/1 Knapsack with Weight and Volume LimitsONSITE INTERVIEW · Seen Nov 2026
- Batched Subsequence Word MatchesONSITE INTERVIEW · Seen Nov 2026
Similar questions at other companies
- Merge IntervalsApple · OA · PHONE SCREEN · ONSITE INTERVIEWApple interview questions
- Merge Overlapping IntervalsAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
- Maximum Concurrent Processes (Bar Raiser Round)Amazon · PHONE SCREEN · ONSITE INTERVIEW
- Meeting Scheduling SystemHevo Data · ONSITE INTERVIEW
- Maximum Intervals Overlapping a Fixed-Length WindowBooking.com · ONSITE INTERVIEW
- Meeting Rooms IISalesforce · ONSITE INTERVIEWSalesforce interview questions
- Generate Complete Inputs for a Supplied ClassifierGeneral Motors · ONSITE INTERVIEW
- Minimum Meeting Rooms with AssignmentsUber · PHONE SCREEN · ONSITE INTERVIEWUber interview questions
- Peak Bike Demand IntervalsFaire · ONSITE INTERVIEW
- Merge IntervalsSafe Security · ONSITE INTERVIEW