Flight Network Interview Question

question from coding, data structure