Skip to content

Commit 6f91b88

Browse files
committed
Updated readme
1 parent c167e39 commit 6f91b88

File tree

25 files changed

+196
-111
lines changed

25 files changed

+196
-111
lines changed

README.md

Lines changed: 110 additions & 110 deletions
Large diffs are not rendered by default.

src/main/python/g0001_0100/s0034_find_first_and_last_position_of_element_in_sorted_array/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ This code defines a `Solution` class with a `searchRange` method to find the sta
107107
## Solution
108108

109109
```python
110+
from typing import List
111+
110112
class Solution:
111113
def searchRange(self, nums: List[int], target: int) -> List[int]:
112114
ans = [-1, -1]

src/main/python/g0001_0100/s0035_search_insert_position/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ This code defines a `Solution` class with a `searchInsert` method to find the in
109109
## Solution
110110

111111
```python
112+
from typing import List
113+
112114
class Solution:
113115
def searchInsert(self, nums: List[int], target: int) -> int:
114116
low = 0

src/main/python/g0001_0100/s0064_minimum_path_sum/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ This implementation uses dynamic programming to efficiently calculate the minimu
8080
## Solution
8181

8282
```python
83+
from typing import List
84+
8385
class Solution:
8486
def minPathSum(self, grid: List[List[int]]) -> int:
8587
n = len(grid)

src/main/python/g0001_0100/s0073_set_matrix_zeroes/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ This solution has a time complexity of O(m * n), where m is the number of rows a
8787
## Solution
8888

8989
```python
90+
from typing import List
91+
9092
class Solution:
9193
def setZeroes(self, matrix: List[List[int]]) -> None:
9294
"""

src/main/python/g0001_0100/s0074_search_a_2d_matrix/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ This solution has a time complexity of O(m + n), where m is the number of rows a
7979
## Solution
8080

8181
```python
82+
from typing import List
83+
8284
class Solution:
8385
def searchMatrix(self, matrix: List[List[int]], target: int) -> bool:
8486
endRow = len(matrix)

src/main/python/g0001_0100/s0075_sort_colors/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ This solution sorts the colors in-place using a one-pass algorithm with constant
9898
## Solution
9999

100100
```python
101+
from typing import List
102+
101103
class Solution:
102104
def sortColors(self, nums: List[int]) -> None:
103105
"""

src/main/python/g0001_0100/s0078_subsets/readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ This solution generates all possible subsets using backtracking. It explores all
7373

7474
```python
7575
from itertools import combinations
76+
from typing import List
7677

7778
class Solution:
7879
def subsets(self, nums: List[int]) -> List[List[int]]:

src/main/python/g0001_0100/s0079_word_search/readme.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ This solution explores all possible paths in the grid to find the word using bac
103103
## Solution
104104

105105
```python
106+
from typing import List
107+
from collections import Counter
108+
106109
class Solution:
107110
def exist(self, board: List[List[str]], word: str) -> bool:
108111
n = len(board)
@@ -116,7 +119,8 @@ class Solution:
116119
c = Counter()
117120
for line in board:
118121
c.update(line)
119-
return Counter(word) <= c
122+
w = Counter(word)
123+
return all(c[ch] >= count for ch, count in w.items())
120124

121125
if not is_sub(board, word):
122126
return False

src/main/python/g0001_0100/s0084_largest_rectangle_in_histogram/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ This solution efficiently finds the largest rectangle area in the histogram usin
7272
## Solution
7373

7474
```python
75+
from typing import List
76+
7577
class Solution:
7678
def largestRectangleArea(self, heights: List[int]) -> int:
7779
lefts = [0]

0 commit comments

Comments
 (0)