Is it allowed to answer question you asked ? When I press answer button, one of options is "Are you sure you want to answer your own question?" I answered one of question I asked and got in trouble with people. I'm just new here and want to play by the rules. Thanks.
It is fine to answer your own question. This is particularly encouraged if your question was resolved in back-and-forth comments but no actual answer was posted.
That you "got into trouble" after posting an answer could have something to do with the quality of the answer; I can't tell since the answer was deleted.
And since you want to play by the rules, I will add some suggestions: (i) proofread what you post; (ii) do not omit important information from a question and then casually add it in a comment, without editing the question.