Algorithm · Walmart Labs · Medium
Requirements The input is intervals: int[][], where every entry has the form [start, end]. Combine intervals that overlap or meet at an endpoint. Along with each combined range, retain the minimum and maximum original array indices among all intervals absorbed into it. Produce one output row for every resulting range as merged_start merged_end first_input_idx last_input_idx (the precise mechanism is determined by the harness; display test cases before returning). Examples…
Checking your access…