# Algorithms 101

### On This Page

## Smart / OKR

### SMART

Specific:

- Goal: prepare for contests. Pass 50->75->100% of contest problems in time
- Improve python skills.
- Improve understanding of common algorithms and data structures.

Measurable: *How will we know that change has occurred?*

- solve top 100 questions that cover common algorithms and data structures.

Achievable:

- participate in LeetCode contest, solve 50%+ problems in time.

Relevant: *Is it possible to achieve this objective?*

- achievable with practice.
- improve skills in solving business problems more efficiently, quickly, understandable.

Time-Bound: *When will this objective be accomplished?*

- 1-2 hours a day, 5-6 days a week, ~5 problems a week
- first contest after 20% problems pass.
- 20 weeks from start.
- Summarize results on 28 Feb 2023

### OKR + roadmap

- pass 20 problems: (4 weeks, 12 Nov 2022)
- Ability to define algorithm/idea of solving problem.
- participate in contest, solve minimum 1-2 problems in time.

- next participate in contest/solve contest tasks
**every week**:- solve minimum 1-2 problems.
- fix results, correct next goal keys if I go ahead.

- pass 40 problems: (10 Dec 2022)
- participate in contest, solve minimum 2 problems in time.

- after 50 problems have a rest one week. (24 Dec 2022)
- pass 70 problems: (28 Jan 2023)
- solve next 10 medium problems without hints effectively.

- 80-100 problems: (28 Feb 2023)
- have understanding in which topics I have gaps.
- emphasize problem solving on these topics in addition to the tasks on the list.

- Sum up results (28 Feb 2023)

## Solving plan

- open task
- read
- first thoughts
- spend
~~15~~10 minutes on coding/drawing/understanding algo - finished or not, read hints
- spend 10 minutes on fixing if needed
- read solution, discussions
- if there is a new algo, read theory the rest of first hour, practice
- code from scratch with comments/code snippets
- repeat 7-9 until tests pass

## Prepare environment

- vscode

to observe any change in python use **nodemon** npm package

```
npm i -g nodemon
```

run python file:

```
nodemon --exec python p.py
```

### Template

```
from typing import List
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
return 1
nums = [1,2,3]
target = 5
s = Solution()
res = s.twoSum(nums, target)
print(res)
```

## Problems list

leetcode Top 100 Interview Questions

List of problems cis mutable. Will take first not solved until all first top 100 problems are solved. It can take + ~5-15 problems

**More info:**

## Tutorial subscriptions

- https://www.enjoyalgorithms.com/data-structures-and-algorithms-course/
- https://www.scaler.com/topics/data-structures/
- https://leetcode.com/subscribe/
- https://algo.monster/subscribe
- https://www.algoexpert.io/purchase#algoexpert
- Senior Algorithms | Interactive tutorial
- 01.01 Data Structures and Algorithms | Interactive
- Contests