Translation:They would not have let the doctor in.
I say that "They would not let in the doctor" should be true, because I got confused when doing the fill-in-the-blank English-to-Portuguese exercises where the only correct answer input is "They would not let the doctor in". And when I do Portuguese on Duolingo, I turn on the Portuguese part of my brain, which reminds the English part that prepositions really shouldn't go at the end of sentences.
"To let in" is a phrasal verb which permits the separation of the main verb from the particle by an object.
• They wouldn't have let in the doctor
• They wouldn't have let the doctor in.
The rule about no prepositions at the end of a sentence is a myth. English is a germanic language and doesn't follow the grammar for romance languages. The Oxford Dictionary includes an explanation in the link: