Name of the psychological effect that make us see correlation that may not exist
The feeling that the solution is obvious after it is provided is called hindsight bias (aka the &quot;knew-it-all-along phenomenon&quot;).
This feeling is informed by the metacognitive sense of surprise, which itself is a form of processing fluency.  Basically, when the solution to a problem is first given, it is surprising (lacks fluency), and hence judged as difficult.  However, when the solution is known or provided again, it is no longer surprising (has fluency), and hence judged as easy.  People often underestimate the difficulty (or predictability) of solutions (or events) after knowing the outcome, due to this bias.
In the example provided in the question however, it is not clear that you actually know the solution, only that you feel that you know the solution after it was solved by someone else.  In this case, you really do have a case of wishful thinking.