Tapan Rachchhtapanrachchh.hashnode.devยทJun 29, 20242192. All Ancestors of a Node in a Directed Acyclic Graphclass Solution: def getAncestors(self, n: int, edges: List[List[int]]) -> List[List[int]]: visited = set() adjList = defaultdict(set) parents = defaultdict(set) # Create adjacency list for (a, b) in edges:...leetcodeAdd a thoughtful commentNo comments yetBe the first to start the conversation.