You will do a lot of things wrong over your career. You will try something and it will fail. You will start down one path and realize you could have done something much better...
You'll probably also solve a problem one day and say to yourself, "Damn. Now THIS is some awesome code." Then a few years later you'll look back at that work and laugh at past-Lith for being such an ignorant newbie.
Like others have said before, you'll get better through practice. Since you're 17 and started programming a couple of years ago, I wouldn't worry too much about it. You're motivated to learn and are programming in your free time. Good job.
And one reason the solutions look easy online is because you're looking at the solution. You're not watching a video of some mathematician staring at a whiteboard for hours at a time, trying and failing a hundred different times. You get to see his nice proof on a clean sheet of paper without any scribbles or teardrop stains. :)
- Eck