I’m 33, when I was ~17 I took a discrete math course. During class teacher posed a challenge- to find algorithm for minimal number of cross beams to make an n by m lattice rigid, so it can’t flex like a parallelogram because triangles are fixing angles. I was asleep, realized I was dreaming, and decided to “work” on the problem. I found a solution, woke up and wrote it down. I think it was helpful to be dreaming because usually I cannot visualize more than simple shape, but while dreaming, I could try things out without using paper and pencil.