Apparently sleeping is a great way to improve your problem-solving abilities, according to Sara Mednick, PhD, assistant professor in the department of psychiatry at the University of California, San Diego.
The REM (rapid eye movement) stage of sleep which is also when we dream, may help us to reorganize our thoughts and reintegrate our experiences, and come up with ideas we might not otherwise think of.
"During REM sleep, the hippocampus shuts down and allows the information it stored to move into the neocortex, the part of the brain that holds the sum of all of your experiences. Once a memory or experience reaches the neocortex, it can be associated with all the other memories."
Mednick suggests that this doesn't only happen during your sleep at night. A nap that is at least an hour to an hour and a half long can take you into REM sleep, and can have surprising results in enhanced memory integration.