This question has been asked before on StackOverflow but I don’t find any genuine solution so I am posting it again.
I came across a problem recently where it was asked to count the number of cycles in a directed Graph ?
I did it using DFS but it didn’t pass all the cases. I want to know how we can solve this problem ?
Source: Windows Questions C++