Question d’entretien chez HackerRank

question on HashMap and Cycle Detection