DoorDashSoftware Engineer · Take-home ProjectCodemia practiceTopological Sort on string
Given a directed acyclic graph (DAG) represented by a list of strings, where each string represents a task and directed edges indicate dependencies between tasks, implement a function to perform a topological sort on the strings. The output should be a list of strings in a valid topological order, ensuring that for every directed edge from task A to task B, task A appears before task B in the output. If a valid topological order is not possible, return an empty list.
Medium
Coding & Algorithms