• + 1 comment

    i'm having this doubt ...

    once the person enters the loop then he cannot escape out since it is a directed graph and hence "Infinite paths",

    but if he is able to choose a path other than the "looped path" and reaches the destination, then we are supposed to count that path as valid....

    so according to the question is this what i have to do?

    please help!!

    for eg : consider the path

        1->2
        1->3
        2->3
        4->2
        3->4
        4->5
    

    in this 2->3->4->2 forms a loop path

    but 1->3->4->5 can lead to the destination