I've long ago realized that going to sleep with a prepared mind (occupied by the problem) would often result in a working solution when waking up in the morning.
Once read an article that research showed that studying before sleep would increase retention 30% compared to studying in the morning. So at night your brain is actively working and you can take advantage of that.