How to solve a problem in Competitive Programming ?

Sibani Krishna Choudhury
3 min readApr 22, 2020

--

This is a very informative blog , Where you will find information regarding “how to approach a problem in Competitive programming ?” . If you want to know the best Source to learn competitive programming you can check my blog on this. So below are my experience that how i do coding and what i observe in it. I try to put all these experience in a best way as much as i can.

Prepare your mind

Before solving a question you need to prepared yourself mentally and of course you are trying to solve a new thing you will be excited , be prepared mentally that if problem will not solve by any cause then you can avoid the Panicness , so that you can understand the reason that why you are unable to solve that problem. Always be ready to face any situation.

Understand the Question

Before thinking about solution to that problem you must need to be sure that What exactly the problem is and what solution you need to give, because without understanding a problem properly ,if you are thinking for solution obviously you are going to waste lots of your time and you will be confused about the problem, So before solving it ask clarifying question if you are doing it in an interview or if you are just practicing try to be clear about question as much as you can.

Solve the Problem

After clarifying your doubts now it’s time to solve the problem , So the very first thing what i do is try to recall whether i have done the same or similar types question before or not, if i have done then i can implement similar solution for this problem if not , i take 30 -40 minute to solve this without seeing the solution. In that 30 minutes i apply all past problem solving Technics to solve that problem, if i successfully get the solution then it’s great, if not,then i see the solution and then i need to analyze that why i am not able to solve this problem.

In most of cases you will find one of two reasons => 1: This is a Complete new problem 2: Something doesn’t came into your mind that you have previously knows.

Understand the Solution

While seeing a solution You need to make sure that you are not understanding the solution for this question only , if you are understanding the reason of solution then you can apply this tricks in most of coding problem . So while understanding the solution go into the deep of it , ask question more , keep the tricks in mind and the reason (“ why this solution is for this question”).

Then the next thing is to understand the time and space complexity .learn how to calculate Time and space complexity very deeply .Without understanding all these things never go for the next question.if you are moving to next without following this things , you will not get desired output rather than you will waste lots of your time.

Do Coding

If you have found the problem solution,now it’s time for coding. Try to code first in whiteboard and then with laptop in your favorite IDE . if you get stuck at one point try for 10 minute more and then without wasting more time see the solution and understand your mistake. If you have already seen solution before you can code it easily but, be aware that you understanding things properly.

Testing

Testing is the most important things in programming . Testing means checking correctness of the code by putting it in different test cases(whether it giving desired result or not). Before done with your coding you need to apply test cases to complete the coding.

I will make separate blogs in each topic of this blog to understand this properly, So stay tune with me.The last and the most important thing is that you need to be practice coding regularly . Be Honest with your effort ,put 100% daily and you will be definitely great in this.

ALL THE BEST.

--

--

Sibani Krishna Choudhury
Sibani Krishna Choudhury

Written by Sibani Krishna Choudhury

Hey guys !! I am currently working as a software engineer. I love programming and Technology. also Love to smile always😊😁

No responses yet