Skip to content

Commit

Permalink
[Add] compare codes for week-3
Browse files Browse the repository at this point in the history
  • Loading branch information
junnei committed Nov 18, 2024
1 parent cb2a52f commit 995e6b0
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
9 changes: 8 additions & 1 deletion docs/leet-code/week-3/1.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,12 @@ sidebar_position: 1
[**View Problem**](https://leetcode.com/problems/daily-temperatures)

```python 0739-daily-temperatures
print("Hello, World!")
import random

sizes = [100, 1000, 10000, 100000]
datas = [
[random.randint(30, 100) for i in range(size)]
for size in sizes
]
func_name = "dailyTemperatures"
```
13 changes: 12 additions & 1 deletion docs/leet-code/week-3/2.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,16 @@ sidebar_position: 2
[**View Problem**](https://leetcode.com/problems/valid-sudoku)

```python 0036-valid-sudoku
print("Hello, World!")
import random

elem = ["."] + [str(i) for i in range(1, 10)]
sizes = [1]
datas = [
[
[elem[random.randint(0, 9)] for _ in range(9)]
for _ in range(9)
]
]

func_name = "isValidSudoku"
```
9 changes: 8 additions & 1 deletion docs/leet-code/week-3/3.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,12 @@ sidebar_position: 3
[**View Problem**](https://leetcode.com/problems/group-anagrams)

```python 0049-group-anagrams
print("Hello, World!")
sizes = [3]
datas = [
["eat","tea","tan","ate","nat","bat"],
[""],
["a"]
]

func_name = "groupAnagrams"
```
8 changes: 7 additions & 1 deletion docs/leet-code/week-3/4.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@ sidebar_position: 4
[**View Problem**](https://leetcode.com/problems/kth-smallest-element-in-a-bst)

```python 0230-kth-smallest-element-in-a-bst
print("Hello, World!")
sizes = [2]
datas = [
(list_to_tree([3,1,4,None,2]), 1),
(list_to_tree([5,3,6,2,4,None,None,1]), 3)
]

func_name = "kthSmallest"
```

0 comments on commit 995e6b0

Please sign in to comment.