Graph Similar groups in anagrams ,Solution Find Eventual Safe States (Detect if node is a part of a cycle ) ,Solution