“When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong.”
The idea behind the quotation
A solution should work, but its elegance also matters: if it lacks beauty, the speaker takes that as a sign that something is wrong.