Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
What if we can reach to a cycle from the source node?
Then the answer will be false, because we eventually get trapped in the cycle forever.
What if the we can't reach to a cycle from the source node? Then we need to ensure that from all visited nodes from source the unique node with indegree = 0 is the destination node.