The structure seems clear: a las dos horas de = within two hours of; a los tres años de = within three years of, etc. The question was this, though:
________, tuve que llamar al médico.
Within 2 hours of being sick, I had to call the doctor.My answer was: a las dos horas de vomitar, whereas the correct answer was a las dos horas vomitar. ¿Por qué?