I shared this question with an answer. Now it has been put on hold. I wonder if I need to mention in question itself that I am posting my own answer. Or maybe, this site expects questions to be of high level. My not-so-good question is getting not-so-good reaction.
I think this is acceptable use of the site. I've done the same thing, when I've written a question, and along the way have come up with an answer, but I might not have come up with the canonical answer (it might be, but I can't be sure without asking).
I hazard a guess that the question was closed mostly because people did not notice it was you that wrote the first answer. Answers don't show up on the review queue, and, even when not using the review queue, it takes some effort to realise that the OP posted an answer.
So the original version of the question:
Find the number of 3 digit numbers (repetitions allowed) such that at least one of the digit is 9.
looks like a problem statement question, and probably was closed as such. So comments like the one you subsequently added can be helpful in explaining why you'd want to do this:
I've posted my answer below. If there is a better way to solve this question, I would be glad to learn about that.