Back at the Barnyard
A Beautiful Freddy (2x29)
:
After Freddy gets struck by lightning, he becomes a genius and knows everything, so they get him to compete in a trivia show so they can win a million dollars. But then they realize that Freddy's intelligence is only temporary and he becomes stupid again after a prolonged period of time.