xAISoftware Engineer · Technical ScreenCodemia practiceTopological Sort on interval list
Given a list of intervals, perform a topological sort to determine a valid ordering of the intervals such that no two overlapping intervals appear in the sorted order. The input will be a list of intervals represented as pairs of integers, and the output should be a list of intervals in a valid topological order. If no valid order exists, return an empty list.
Medium
Coding & Algorithms