Daughters' Ages

Two MIT math grads bump into each other at Fairway on the upper west side. They haven’t seen each other in over 20 years.

The first grad says to the second: “how have you been?”
Second: “great! i got married and i have three daughters now”
First: “really? how old are they?”
Second: “well, the product of their ages is 72, and the sum of their ages is the same as the number on that building over there..”
First: “right, ok.. oh wait.. hmm, i still don’t know”
Second: “oh sorry, the oldest one just started to play the piano”
First: “wonderful! my oldest is the same age!”

How old are the daughters?
Respond with daughter ages sorted in ascending order and concatenated together. No spaces.

Sign Up
to access hints and editorial solutions for Daughters' Ages
Asked In:
  • Google
Click here to start solving coding interview questions