The first step to getting started with competitive programming is to learn a programming language. If you already have a preference, any language would do. If you have just started learning a new language, C, C++, or Java are the most recommended languages as most problems are set, keeping in mind these languages. The reason is that time of execution is a critical factor in Competitive Programming. Choosing a language whose time of execution is fast is sure to give you an advantage
You do not need to know advanced concepts, like classes or generics/templates. You should know if/else, loops, arrays, functions and have some familiarity with the standard library, like math functions, string/array operations, and input/output.
Note: Start your quest by solving simple problems such as finding a prime number, the number of factors of a number, the number of digits in a given number, searching a number in an array, basic problems using loops, functions, and string, etc. These types of problems can be found in HackerRank as recommended. These problems might seem simple, but constantly practicing these problems at the beginning of your journey will improve your speed, thinking, and develop an essential skill of writing error-free code.
To move forward as a competitive programmer, Data Structures and Algorithms will be your long-term partner who will help you solve problems with low time and space complexities. The time complexity of an algorithm is the algorithm's amount of time to complete its process as a function of its input length, n. The time complexity of an algorithm is commonly expressed using asymptotic notations:
In Competitive Programming, it is crucial to be consistent and constantly keep solving problems daily. When practicing, sometimes, you will not be able to solve problems. In these situations, Do not give yourself up quickly! Continue to try! However, sometimes, we are not able to solve it even after struggling for hours. It is advisable to look at the editorials in those situations. Step-by-step editorials clarify how to solve a problem. You will also learn new and creative ways to solve problems by reading them. So often, even though you have been able to solve a problem, you should read editorials. Also, sometimes you should look at other codes. It also helps you find new ways to solve problems. Competitive Programming is much fun when you involve your friends. Continually participating in contests with your friends and discussing different approaches will keep you motivated and pumped up always.Once you understand the techniques of solving the problem and become quite familiar with the language and problem solving, it is highly recommended to start participating in contests on platforms such as Codeforces, CodeChef, or LeetCode.