Question d’entretien chez World Wide Technology

Algorithm question. Solve and write pseudo code on the white board.