# Algorithm

10/14/2020

This site is composed of notes for algorithm problems I solved, mainly on LeetCode (opens new window).

## # What is an Algorithm

An algorithm is a sequence of steps, which solves a problem when carried out in order.

## # Why I Am Doing This

While most people do LeetCode to find a (better) job, I do it for multiple reasons: review my algorithm knowledge, improve coding skills, and of course be ready to find a CS job.

## # Languages

Now I use Python3.

### # Java

As SN once told me Java is better to explain the underlying data structures than Python, I tried it for a while, until I realized that I cannot tolerate its verbosity anymore.

### # C++

I can read many solutions in this language. However, C++ is known for a steep learning curve, and I don't think I have enough time and motives to embark on such a journey.

### # Python 3

My officially first programming language is Python 2, from which I learned `if`, `for`, `while`, simple but useful data structures like `list` and `map`, and finally even a little OOP before learning Java. Several years later, Python 2 is extinct and Python 3 inherits the simplicity and elegance.

Thus, now I am using Python 3 to solve algo problems.

## # Blog Structure

Following is the structure for each blog:

• picture or link of problem
• code snippet/driver code if any
• solution
• state the brute force solution
• elaboration of algo
• time&space complexities
• code (the boilerplate `class Solution:` is ommited)
• follow up or note if any