Amadeus Interview Question

core java puzzle