Question d’entretien chez Skyscanner

Write a pseudo-code with the most efficient algorithm possible for a particular puzzle.