This question already has an answer here:
Asking "what have you tried" is based on the assumption that the author did not make any effort. People don't want to make an effort if they assume someone else didn't. No matter how much they love coding, if someone else seems to lack motivation, their motivation is gone in an instant. The same is the case with remarks regarding "homework".
Example: Find peaks in list with custom type
But having gotten some imperfect approach, people (usually different ones than the "what have you tried"-people) reply with a perfect solution they could have come up right from the start.
Also it could be that the people replying want to correct the author's approach to make it better. But then, if the author contributes his approach the solutions being given do not include the approach but go an entirely different route, which leads to the conclusion that you could have saved your effort of sharing your approach. Sometimes I see replies like "I asked my cat for an answer and she hates me now, so I ask here" and people reply.
Seems like you need to just get past the first person asking "what did you try" without giving something for others (who happen to have mod-rights more often than not to quickly close the topic) to work with like "idiot" (which fits perfectly whether you like it or not) or "a lot" or similar and you get your desired replies.
I suggest treating those "what have you tried"-phrases as what they are: spam and reconsider the "what have you tried"-phrase-author's mod rights.