An idea struck me.
I suddenly got an idea.