Amadeus Interview Question

2 Puzzles , basic dsa , core subjects