this would be sufficient to traverse the graph forward. but in part 1 you need to traverse the graph backward, and for that a different structure might be easier. I made a defaultdict of sets for the containers. In the 2nd part you need to traverse forward but there is an extra gotcha…