30/2 = <<30/2=15>>15 students answered green.

18/3 = <<18/3=6>>6 girls answered pink.

So, 15 + 6 = <<15+6=21>>21 students answered either green or pink.

Therefore, 30 - 21 = <<30-21=9>>9 answered yellow.

# Answer

9
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
Miss Molly surveyed her class of 30 students about their favorite color. Half of the class answered green, one-third of the girls answered pink, and the rest of the class answered yellow. If there are 18 girls in the class, how many students like yellow best?
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
9
Miss Molly surveyed her class of 30 students about their favorite color. Half of the class answered green, one-third of the girls answered pink, and the rest of the class answered yellow. If there are 18 girls in the class, how many students like yellow best?
train