Getting started with Competitive Programming

Getting started with Competitive Programming

Build your algorithm and data structure skills

·

5 min read

My LeetCode Profile With 4⭐ Rating

Mt Daily Routine

main-qimg-6aaee41ccd525d61717329fc3e82d334.png

Before talking about competitive programming I would like to talk about what is Competitive Programming? Competitive Programming: Generally competitive programming is a mind sport where everyone showcase his/her skills of problem solving under various constraints(that force everyone to think deeply or efficiently). Anyone who does competitive programming can enhance his/her problem solving approaches.You will learn how to approach a problem with the best of the best possible ways, you will learn how to analytically think and solve a problem and analyze it's space and time complexity.

Key things required to be regular in Competitive programming:

Patience

Most important thing you need to learn is patience while doing the problems. Anyone who starts competitive programming as a beginner face impatience, and the reason behind this is that he/she is not getting the AC(the most awaited green sign) on some problems even after trying that problem since last 2 or more days, and this leads into the impatience. I have met many people who starts the competitive programming and left it just after a week, and the reason will surprise you, they all left the competitive programming because of impatience and they all used to say that we can't waste our time on a single problem for more than few hours.So please you need to patience and gradually you will surely feel the improvement in solving problems.

Do participate regularly in contest:

Please do participate regularly in as many as contest you can, why because participating in the contests you will learn many new topics and will get experienced how to fight with the programmers from across the globe.But please make sure as a beginner you will face some difficulties while solving the problems in any ongoing contest because there will be some pressure of getting ranked above your competitors.Sometimes you will also find decrement in your rating, but please don't get demotivated or discouraged everyone have gone through all these things to become a successful programmer,rating is just a matter of time as the time will pass and you will keep practicing,then you will see increment in your rating.

Key steps in learning Competitive programming:

Choose any well known programming language used for Competitive programming:

You can do competitive programming in any programming language but it is highly recommended that you choose one of C/C++ or Java. The reason being that the time of execution is a key factor in Competitive Programming and so, choosing a language whose time of execution is fast is surely going to give you a benefit. C/C++ and Java are relatively faster, particularly when compared to languages like Python. Python is slow as compared to C/C++ and JAVA,that's why very less number of programmers used to do Competitive Programming in Python due to its time factor which is highly prioritised in Competitive Programming.

Choose some platforms to practice Competitive programming and to participate in contest:

As per my personal experience if you are a beginner i will recommend everyone to start with LeetCode ,it has really the best user interface and IDE. LeetCode has a good set of problems for beginners placed in well defined manner according the tags and difficulty levels.The main thing that LeetCode provide to the users is that if you get stuck on some problem from very long time and only passing some of the test cases, then you can download the test cases and you can review your logic to do some modifications,it will help in thought process to be able to think about corner test cases.But seeing the test cases is not always good, after some duration(about 2 or 3 months) you itself should be able to think that which test case might give WA(wrong answer).

Get your hands dirty in Data Structures:

Data Structures are something that helps you in making the program more efficient. Having good amount of knowledge in Data Structures will help you in selecting the optimal Data Structure for any problem. Anyone can learn Data Structures from GeeksForGeeks, it contains Data Structures tutorials and problems in rich amount.

Get your hands dirty in Algorithms:

Algorithms are something that use various data structures to implement the logic and then we get the result in form of output produced by the algorithm. You need to be very good in Algorithms, again GeeksForGeeks contains Algorithms in rich amount.

Time/Space Complexity: Every Algorithm has a Time and Space complexity which refers to the maximum amount of time an Algorithm will take and the maximum amount of memory an algorithm will require. While doing Competitive Programming these two will play a key role in determining the verdict of your solution.

Always try to think of the most optimal solution, that is, one which runs with least time complexity and occupies minimum space.

Sorting: You must have heard of a number of sorting techniques to sort but while doing Competitive Programming most of those techniques prove to be time-consuming hence the STL library comes to rescue, it offers a function sort() which sorts the array in the most optimal way.

Keep Practicing practicing …….. Practicing:

Always keep yourself motivated enough to solve the problem, it will help you in enhancing your problem solving skills. As now you have good knowledge of Data Structures and Algorithms you can do really well in world of Competitive programming if you keep practicing continuously.