must actually have dreamed it before the solution even though I dreamed I did it afterwards.
That is interesting. Though I don't know if that's necessarily the interpretation, if it had happened to me I might consider the possibility that I first dreamed I had an elegant solution without actually containing the specific answer, even though I thought I did, and then dreamed the working, and then woke up and filled out the working subconsciously to have the answer and assumed that was the answer I had at first.
This was one of the more involved IMO past-paper questions. I really doubt I was capable of retconning a fully-worked solution subconsciously once awake.
Hmmm. FWIW I am capable of debugging while asleep. When I wake up I have a clear image of the bug, where I hadn't noticed when I went to sleep that there was a bug, nor did I know that I recalled my source code so exactly. (Unless I subconsciously noticed it when writing the code, and that information took a while to surface.)
That is interesting. Though I don't know if that's necessarily the interpretation, if it had happened to me I might consider the possibility that I first dreamed I had an elegant solution without actually containing the specific answer, even though I thought I did, and then dreamed the working, and then woke up and filled out the working subconsciously to have the answer and assumed that was the answer I had at first.