Questions are protected from deletion by the author in 3 cases:
- The question has multiple answers.
- The question has a single answer with an upvote.
- The question has an accepted answer (which is not really a serious deterrent since the OP can unaccept an answer before deleting, but is included here for completeness sake)
In your case, the OP appears to have deleted the question before your post was able to get upvoted and before anyone was able to leave a second answer.
In some cases, it could be an innocent coincidence, in that the OP decided to delete right before you left your answer and you managed to sneak your answer in first. But it is just as common (or perhaps more so) that the author waited for an answer and immediately deleted the question (usually happens with homework so the OP doesn't get caught for cheating).
You may also be interested to know that this type of deletion could be considered a hostile act by the system, and users who continually do this are very likely to earn themselves a question-ban.