Question d’entretien chez Vanguard

Write an algorithm and explain its complexity