What happened to you here is a bit of an edge case, so allow me to extend my apologies for the poor first impression.
You see, normally, the way you share a solution to a question is by posting an answer. At the bottom of every question page, you'll see a big textbox where you compose your answer (using Markdown syntax), and then click the big blue "Post Your Answer" button:
This doesn't require any reputation and can be done by new users and veterans alike. Questions and answers are the lifeblood of this site, so we encourage everyone to share their solutions to questions (as long as they are different from the answers that have already been posted).
Comments are a bit different. We do restrict those for brand-new users by requiring that you have a minimum of 50 reputation in order to post them. This is designed to keep down spam and shouldn't be a big limitation to getting started—comments are intended for asking clarification questions and should be used sparingly. Complete questions ready to be answered don't require comments. And when you do get to 50 reputation, please don't post answers in comments.
A brief note regarding reputation: it isn't something that you purchase (everything here is free), it's something that you earn. How do you earn it? By contributing useful answers, of course! And also by posting good questions. This should have all been explained to you in the Tour. A few good answers is usually all you need to get to 50 reputation (a single upvote on an answer gets you 10 reputation—it adds up quickly!).
Anyway, all of this is how things usually work. What happened in your case was that the question you were looking at had been automatically "protected" by the system, which restricted your ability to answer it. Questions are automatically protected when they have been attracting a large number of spam, "thanks", and "me too" posts. As the Tour explains, these are not answers by Stack Overflow standards, and we don't want them in the answer box. To decrease moderation overhead, questions that have, for whatever reason, become targets for these types of non-answers get protected so that you need to have a token amount of reputation (10 points) to answer them.
I used the word "token" there because the system really does consider 10 reputation to be a very small amount. Only one upvote on an answer and you'll have enough to answer protected questions. Only brand-new users are barred from answering them. Unfortunately, there are edge cases where brand-new users have something constructive to share and our system gets in the way of that. That's what happened to you. Sorry.
On protected questions, the answer box isn't even shown to new users. Instead, there is a little yellow banner message that tries to spell this out:
The best thing for you to do would be to browse around and see if there is another question you can help to answer. If so, post that answer, get your upvote(s), and then come back and answer this one. Again, my apologies for the friction. Welcome to Stack Overflow, and thanks for trying to share your knowledge!