new to programming


i am very new to c and C++ programming

i find most of the programs even in easy section tough and solutions are like alien to me

what should i do?


Well, once again, here we are back on this same old topic…

I have seen and agreed and even upvoted basically any answer regarding this question, mostly, because as @junior94 said here, it all depends on each person’s background, on each person’s logical thinking, fast typing, creativity, or any other completely irrelevant aspects in terms of helping you on your question.

However, there IS something you can actually do about this matter and that I find (as time passes by) to be true.

That thing is practice. That is all. Nothing else.

At some point, when you are attempting a problem whose theory that lies behind it is totally new to you, I would recommend you to read wikipedia articles about it ALONG with a good reference book (I own a paperback copy of the worldwide famous “Introduction to Algorithms”, by CLRS and I read it from time to time). That study is NOT for problem-solving purposes. That study will serve for the concepts to stay in your mind while you sleep, to “tune” your head to that concepts if you’d like to think about it that way.

It may seem demotivating that even after reading some dozens (possibly hundreds) of pages you see no improvement on your contest performance, but, as you will see, if, after attempting a problem many times you read its editorial here (the editorials ARE the best learning resource I’ve ever came across on ALL of Internet and I am not exxagerating) and if alongside with it you search and read some AC codes in your favourite language (choose codes from “middle and down of the table”, as codes by “pros” are usually too syntactically advanced for humans to understand :stuck_out_tongue: ) you will begin to spot patterns that were before hidden to your eyes and brain… And, as time passes by, you will get better and better, this, I can tell with 100% sure :smiley:

Just keep learning from other coders and from editorials, be enthusiastic… and you will get better… By better I don’t mean becoming a top competitor, but surely you will be able to solve 4/5 problems on a more consistent basis as time will pass by… It might take 1,2 months/years depending on your previous skill… But you will get there if you walk along the path of enthusiasm and work… (some awesome coders from here taught me this!! Kudos @xpertcoder and @junior94 and @scep2 and @devanshug).

Best of luck,



learn & practice, especially persist

1 Like

couldn’t have put this better - “as codes by “pros” are usually too syntactically advanced for humans to understand :p”…:smiley:

Well for starters you can begin with writing down the pseudocode of how you would proceed in solving the problem and check manually if it works for small inputs. Code it up and then see the verdict of the judge. Don’t get disheartened if it results in a TLE or WA. Just identify the corner cases or sometimes it might need you to start off thinking with a totally different approach. If not able to get the reason for why your code doesn’t work, read the editorials. Usually you may find that the method you used is right but its translation into the programming language might be the problem. Now it comes up to reading others code. A good knowledge of data structures and understanding of the programming language of your choice is essential. You can surf it online, watch various video lectures of universities etc.

This may seem really tedious at first and you may think your progress ain’t exponentially rising instantly but that’s when you don’t give in and keep putting your level best. Keep practicing and code with this ideal - “Can it be done better?”. As you keep practicing you will learn various algorithms and more and eventually you will rise up in rankings and improve your coding skills!

1 Like

@kuruma I just started with “Introduction to Algorithms”. What kind of approach did you follow to read it? Read it from beginning to end or picking out problems that you were facing?

Some answers are already been given to you so just follow them. As as u said “the solutions are aliens to me”. It not only you be sometime most of us find some solutions aliens.

So, in case you browse through the solutions, try to find codes which are neat and clean so that it readable and you can understand how the function are called etc. I have personally found that the fastest codes are harder to understand. :stuck_out_tongue:

You will improve with practice as I am also trying to do so. Initially I solved only 1 problem in the contest but now I am able to solve upto 3. Not to say but all those goes into “Easy” section… lol

1 Like

@kuruma: “once again, here we are back on this same old topic…”. I had an urge to say this so many times. It looks like this question will keep appearing from time to time even though there are a lot of posts regarding this… There should be a welcome page or something like that to guide new users to the right direction. For the time being all we can do as a community is try to guide them ourselves :slight_smile:

1 Like

Yes, this is a topic that will come up all the time… Damned Belarussian geniuses :stuck_out_tongue: It is actually one the most recurring topics which has no right answer… But, as you said, all we can do as a great community we are is to help people with our own experiences the best we can :slight_smile: