Question d’entretien chez bp

Algorithm question with complexity analysis