Pregunta de entrevista de Scry AI

How to identify a loop in a tree or a graph.