In a previous job, I sometimes ran into programming problems that I spent all day trying to figure out - without success. But quite often, when I went home, unwound, went to bed, just the moment before falling asleep, the solution would become obvious.
And nearly every programmer I told about this had experienced the same thing. ;-)
Indeed. The feeling of solving a problem in 5 mins the morning after an entire day of banging my head against the wall is both one of my favorite and least favorite sensations.