Skip to content

Instantly share code, notes, and snippets.

@Corbinj22
Last active February 21, 2020 17:54
Show Gist options
  • Save Corbinj22/868e76c47cee2054c0351a453932c5aa to your computer and use it in GitHub Desktop.
Save Corbinj22/868e76c47cee2054c0351a453932c5aa to your computer and use it in GitHub Desktop.

Lets face it, coding is hard. but... there is some good news.
there are several steps you can take in order to make the process easier.

  1. Understand and Analyse the Problem
    Read the problem, start thinking about it and if possible write the things that are given and the things that you need to find out on a piece of paper.

  2. Go through the sample inputs and examples thoroughly
    Going through some sample inputs and coming up with more examples sure helps you a lot to understand the problem well, and moreover, it gives you a clear way to how many cases your code should handle, and what all can be the possible output or output range.

  3. Break down the problem
    This step is really very helpful when the problem at hand is very big. In such cases, I recommend the following,

    — Divide the problem into different modules or sub-problems
      — Try to make independent functions for each sub-problem

  4. Start solving/coding
    Now that you’ve analyzed the problem it’s time to actually write the code. If you can’t solve the problem fully at once, try writing code for a simpler sub part, as you solve the problem, gradually you keep figuring out the problem in more detail, and you start getting new ideas.

  5. Look Back and Learn More
    Now, this is the most important part! Once you are done, look back whether the code can be improved, is there any other way to solve the given problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment