Oracle Interview Question

One dp question and candle puzzle