I don't think this is specific to programming, but generalizes to any kind of problem solving (as you write in your second sentence).
I was once taking a shower when I cried out in joy as I had just figured out how to shave off an extra fraction of a micron from the side of a large state machine (we had a last minute change order and it hogged a bunch of area on the chip). I grabbed some clothes and jumped into my car (didn't think to rinse the shampoo out of my hair) and floored it down the freeway to the office (VPN? hah!)
I was once taking a shower when I cried out in joy as I had just figured out how to shave off an extra fraction of a micron from the side of a large state machine (we had a last minute change order and it hogged a bunch of area on the chip). I grabbed some clothes and jumped into my car (didn't think to rinse the shampoo out of my hair) and floored it down the freeway to the office (VPN? hah!)