Should I not answer my own questions?
If I solve a tricky problem, should I ask a question about it on Stack Overflow and answer it myself?
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. It only takes a minute to sign up.Sign up to join this community
As I mentioned in my answer the best approach is to post your question, wait a day or so and then post your answer.
You might get a better answer than you already have and also it's not that obvious that you already knew the answer ;)
As noted, it's covered by the FAQ. The only thing that I would add is that the answer ought to be self-contained or, at a minimum if it links somewhere else, it should contain enough material to be useful on its own. If it looks like you are just trying to hype your blog, I think you will be rightly downvoted and/or closed as SPAM.
Also, I think it's a good idea to mention that you will be posting your own solution as one alternative in your question. Giving people a heads up may avoid some unthinking downvotes. A subtle reference to the relevant FAQ is may help, too.
In keeping with the FAQ [link], I'll be providing my solution as an answer.