Original problem: https://brilliant.org/practice/depth-first-search/?p=1
I don't actually know if a solution to the problem is correct or not, but I have noticed a flaw in the explanation witch sometime yields wrong results. I outline the problem on paper, so please forgive my terrible handwriting (and my grammar, I am Russian, don't hurt me).
I am not sure if I am correct or not, but if this is of any use I am happy to help! (don't mind a little reward if you're do that, hehe)
P.S. I forgot to mention on paper: the problem is a little bit modified -- we only looking for number of vertices that are two hops from vertex 1.