Skip to main content

Problem Solving Approach

Example: Write a function which takes two numbers and return their sum.

  1. Can I restate the problem in my own?
  2. What are the inputs that go into the problem?
  3. What are the outputs that should come from the solution to the problem?
  4. Can the outputs be determined from the inputs? do i have enough information to solve the problem ?
  5. How should I label the important pieces of data that are the part of the problem?

Step1 : Understand The Problem Step2: Explore Concrete Examples Step3: Break it Down Step4: Solve it Or Simplify Step5: Look Back And Refactor

節錄自 https://www.udemy.com/course/js-algorithms-and-data-structures-masterclass/learn/lecture/9816152