In Aptive Environmental scheduling, a common algorithm merges overlapping technician service windows. Write a function that takes a list of time intervals and returns a new list with all overlapping intervals merged.
Implement a function merge_service_windows(windows) where:
windows, a list of intervals, where each interval is a list [start, end] of integers.Two intervals overlap if the next interval's start is less than or equal to the current merged interval's end.
Example 1
windows = [[1,3],[2,6],[8,10],[15,18]][[1,6],[8,10],[15,18]][1,3] and [2,6] overlap, so they merge into [1,6].Example 2
windows = [[1,4],[4,5]][[1,5]]0 <= len(windows) <= 10^4windows[i].length == 2-10^9 <= start <= end <= 10^9After implementing the algorithm, write a comprehensive unit test suite. Your tests should verify correctness for normal cases, edge cases, and failure-prone boundaries such as empty input, single intervals, nested intervals, duplicate intervals, and endpoint-touching merges.