Amadeus interview question

In coding it was burnt candle question