Amadeus Interview Question

In coding it was burnt candle question