You're missing a step. The goal of programming is not to just solve a problem, it is to create a solution to a problem. That creating part is the most important part.
You're either being inane, dense, or you're just plain inexperienced. Coding, like math, has an element to creativity to it. If you don't think math has creativity, you don't know anything about more advanced math. However, despite how technically brilliant, how sublime your solution may be, if it doesn't actually SOLVE the problem you set out to solve, it's not very useful.