Skip to content

Commit d3c5e14

Browse files
committed
♻️ [121/README] Runtime 81 ms Beats 69.86% Memory 51.1 MB Beats 97.42%
1 parent f1e4119 commit d3c5e14

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

121/solution.js

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ const maxProfit = (prices) => {
1313
if ((prices[r] - prices[l] > max) || 0 === max) {
1414
max = prices[r] - prices[l];
1515
}
16+
} else if (prices[l] === prices[r]) {
17+
// ...
1618
} else {
1719
l = r;
1820
}

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
# Leetcode Solutions
22
[![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)
33

4+
[Notion Database - all of my notes on the problems](https://enkr.notion.site/db6bbb891f264f37a64c99799ca2057d?v=0b3cf643151b4ec1b29a01eecce8bbb4)
5+
6+
---
7+
8+
# Problems:
49
- [1. Two Sum](./1/)
510
- [2. Add Two Numbers](./2/)
611
- [3. Longest Substring Without Repeating Characters](./3/)
712
- [4. Median of Two Sorted Arrays](./4/)
813
- [5. Longest Palindromic Substring](./5/)
914
- [7. Generate Parentheses](./7/)
1015
- [15. 3Sum](./15/)
16+
- [22. Generate Parentheses](./22/)
17+
- [121. Best Time to Buy and Sell Stock](./121/)
1118
- [198. House Robber](./198/)
1219
- [200. Number of Islands](./200/)
1320
- [213. House Robber II](./213/)
@@ -40,6 +47,6 @@ iex ./.../solution.ex
4047

4148
Quick create in bash
4249
```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
4451
# And TOC above
4552
```

0 commit comments

Comments
 (0)