NOTE: This repository does not focus on the most efficient solution of a problem, rather it focuses on how to approach a problem.
Many beginners in computer science stumble not because they have difficulty in learning a programming language but rather they dont know how to solve a given problem. This repository is created to provide a guide on how to approach a problem and steps involved in solving a problem.
In simple words Problem solving is a process of finding solution of given problem.
When given a problem, there are two mistakes a beginner programmer make, either he straightly jump into the code without planning how problem should be solved or he get stuck on the blank screen which panic him. Rather When given a problem the programmer should follow the following steps:
When someone is given a problem. It can be tempting to straightly dive into the code, but it is better to take a step back and make sure you understand the problem as someone rightly said "Think twice, code once". If at first glance you dont understand the problem, try to restate the problem in your own words. For example you are asked to write a function which implements addition. we can restate this problem into simpler words like "Write a problem which takes two numbers and return their sum".
Divide and conquer is an algorithmic paradigm which simply says break the problem into simple sub-problems, conquer the sub-problems by solving them and then combine the solutions of sub-problems in order to form the solution for original problem.
Pseudocode is a step-by-step written outline of your code that you can gradually transcribe into the programming language. To learn more about Pseudocode and how to write pseudocode checkout this article by WikiHow
When you have your pseudocode ready, translate it to real code.
Hooray! you just learned how to solve a problem using computer.