For one of my class projects, the teacher coded the entire solution, then took out a few sections that we are supposed to complete for our assignment. This incomplete code was distributed to the class as a starting point. When he was writing the solution, he used source control. He forgot to delete his repository, so all of his commits are there... You can checkout the commits to get the full solution. I don't think he is aware of it, because he hasn't brought it up in class.
I found this while I was working on my solution. Once I found it, it was difficult to find a different path to the solution. I think my solution is dissimilar, but I feel I am playing a dangerous game here.
I'm not sure what I should do here. I could choose to not tell him and hope they don't catch it, or I could choose to tell him and basically admit I had access to the solution while I was working on it.