File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ const maxProfit = (prices) => {
13
13
if ( ( prices [ r ] - prices [ l ] > max ) || 0 === max ) {
14
14
max = prices [ r ] - prices [ l ] ;
15
15
}
16
+ } else if ( prices [ l ] === prices [ r ] ) {
17
+ // ...
16
18
} else {
17
19
l = r ;
18
20
}
Original file line number Diff line number Diff line change 1
1
# Leetcode Solutions
2
2
[ ![ wakatime] ( https://wakatime.com/badge/user/849bb989-6c1a-4bb4-a5f1-ba937583da5f/project/d0b05c78-06be-40bb-9bca-1e26b4ccd8db.svg )] ( https://wakatime.com/badge/user/849bb989-6c1a-4bb4-a5f1-ba937583da5f/project/d0b05c78-06be-40bb-9bca-1e26b4ccd8db )
3
3
4
+ [ Notion Database - all of my notes on the problems] ( https://enkr.notion.site/db6bbb891f264f37a64c99799ca2057d?v=0b3cf643151b4ec1b29a01eecce8bbb4 )
5
+
6
+ ---
7
+
8
+ # Problems:
4
9
- [ 1. Two Sum] ( ./1/ )
5
10
- [ 2. Add Two Numbers] ( ./2/ )
6
11
- [ 3. Longest Substring Without Repeating Characters] ( ./3/ )
7
12
- [ 4. Median of Two Sorted Arrays] ( ./4/ )
8
13
- [ 5. Longest Palindromic Substring] ( ./5/ )
9
14
- [ 7. Generate Parentheses] ( ./7/ )
10
15
- [ 15. 3Sum] ( ./15/ )
16
+ - [ 22. Generate Parentheses] ( ./22/ )
17
+ - [ 121. Best Time to Buy and Sell Stock] ( ./121/ )
11
18
- [ 198. House Robber] ( ./198/ )
12
19
- [ 200. Number of Islands] ( ./200/ )
13
20
- [ 213. House Robber II] ( ./213/ )
@@ -40,6 +47,6 @@ iex ./.../solution.ex
40
47
41
48
Quick create in bash
42
49
``` ssh
43
- chapter=121 && mkdir ./$chapter && touch ./$chapter/README.md && touch ./$chapter/ my_solution.js && touch ./$chapter/solution.js
50
+ chapter=121 && mkdir ./$chapter && touch ./$chapter/my_solution.js && touch ./$chapter/solution.js
44
51
# And TOC above
45
52
```
You can’t perform that action at this time.
0 commit comments