Concept: The question tests on the application of Rates(Time and Work)
LCM of 9,3,4 = 36
=> Let the total work be of 36 units
=>Efficiency of X = 36/9 = 4 units/hr
Since it has worked alone for 3 hrs, the units of work completed by X alone = 4*3=12 units
Remaining units/Units completed by both X and Y = 36-12 = 24 units and this must have been completed in 4hrs by X and Y together.
=> Every hour 24/4
= 6 units are produced every hour.
Efficiency of X being 4 units/hr, Y must be producing 6-4
= 2units/hr (This is Y's efficiency)
=>36 units of work Y alone wll take 36/2
= 18 hrs.