My notes from How to think like a programmer - lessons in problem solving.

## 1. Understand

- You understand a problem when you can
**explain**it in plain English. If you can’t explain something in simple terms, you don’t understand it.

## 2. Plan

- Plan your solution. Write down the exact steps.
- Answer this question: “Given input X, what are the steps necessary to return output Y?”.

## 3. Divide

- Break problem into sub-problems.
- Solve each sub-problem one by one.
- After solving each sub-problem, connect the dots.
- Sub-problem doesn’t just mean problems that can be broken down due to their modularity. Sub-problem means try to reduce the problem to something simpler.

If you’re stuck, you should reduce the problem to something simpler. Instead of the third-highest number, what about finding the highest overall? Still too tough? What about finding the largest of just three numbers? Or the larger of two?

## 4. Stuck?

- Happens to everyone. Take a deep breath.
- The difference is better programmers are more curious about bugs/errors than irritated.
- Start anew. Delete everything and begin again with fresh eyes.
- Research but look only for solutions to the sub-problems. Because you won’t have learned.

## 5. Practice

- Try to solve at least one challenge every day.

If you want to see what business leadership may look like in three to five years, look at what’s happening in online games.