802 Find Eventual Safe States
Techniques Used
DFS
Graph
TopologicalSort
Approach
We maintain a value (0, 1, -1) for each node, such that
0 shows the visited nodes
1 shows a safe node
-1 shows a unvisited node
For every node, check
if it has already been visited OR is a safe ...
raahulsaxena.hashnode.dev2 min read