CrossFlight interview question

The coding exercise was expected and the problem was not that complex