The size of the candle 12cm will be reduced as follows:
12-0.5x (x are hours), an the size of the candle 18cm will be reduced as follows: 18-2x, so if you want to find at what time both will be the same height only match the two equations: 12-0.5x=18-2x and solvr for x.
-0.5x+2x=18-12
1.5x=6
x=6/1.5=4 this means 4 hours
If you lit both candles at 6pm then at 10pm they will be the same height
(adittional info: the height will be 10inches)