A question like that isn't generally off-topic, it's just a bad question.
If the author already decided what the solution to their problem must be, than they exclude possible better solutions. Questions like that are also known as XY problem questionsXY problem questions.
The author should be made aware of what they're doing wrong and should be encouraged to edit their question. If they refuse to do that, a downvote is in order.