Aldehyde and ketone reactions
Step P is std base-driven alpha alkylation of ketone. Step Q Wacker details here takes the terminal alkene to methyl ketone then step R is base-catalysed internal aldol mechanism here gives the product shown. So the answer is (b).