Skyscanner interview question

Hackerrank test