Asking the questioner to post a solution as an answer is the right way. After all separating Qs and As is the style here and we should adhere to it.

If the questioner doesn't comply, I would flag it for moderator attention and ask a moderator for separating question and answer.

I would not separate the question and answer myself because this feels like a too big intervention.

If nothing happens I would probably downvote and go on because a question with an answer inside is not really a good question.