# Week #01 of Leetcode (Jun 08, 2024)

So this is my first week of my LeetCode grinding journey, and I want to share my notes and the techniques I’ve learned and the problems I’ve solved each week.

For solving the problems, I’ve created a new Git repository and keep track of my answers by creating a directory for each problem with the following structure:

```
problems
├── 1002_find_common_characters
│ ├── index.md # showing the solutin and notes
│ ├── index.ts # the optimal soltution
│ ├── bruteforce.ts # a brute-force soltuion
│ └── index.test.ts # testing useing vitest
```

### Techniques:

**Two-Pointer/Sliding-window**so in this technique we use two variables act like a pointers, to keep track the current window base on condation ```

**Prefix-Sum**I used this technique to solve the Product of Array Except Self problem, But instead to use a prefix-sum we use here a prefix/suffix-product to get the answer.

**Hash-Map**Absolutely we have to have a problems that the true hero to solve it, just use hash-map.

**kadane algorithm**an algorithm to solve find the largest sum of any contiguous sub-array, by maintaining two values

`max_sum`

and`current_sum`

and compare between them each iteration and take the max values