Skyscanner Interview Question

Standard algorithm questins, fairly straightforward (leetcode easy)