Frage im Vorstellungsgespräch bei Skyscanner

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