Skip to content

Commit 4a74b79

Browse files
committed
update readme
1 parent be579b6 commit 4a74b79

File tree

3 files changed

+7
-112
lines changed

3 files changed

+7
-112
lines changed

1250-longest-common-subsequence/1250-longest-common-subsequence.py

Lines changed: 0 additions & 67 deletions
This file was deleted.

Python/1143-longest-common-subsequence.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ def longestCommonSubsequence(self, text1: str, text2: str) -> int:
1010
T1 = len(text1)
1111
T2 = len(text2)
1212
dp = [[0 for _ in range(T2 + 1)] for _ in range(T1 + 1)]
13-
for t1 in range(T1):
14-
for t2 in range(T2):
15-
if text1[t1] == text2[t2]:
16-
dp[t1 + 1][t2 + 1] = dp[t1][t2] + 1
13+
for t1 in range(1, T1 + 1):
14+
for t2 in range(1, T2 + 1):
15+
if text1[t1 - 1] == text2[t2 - 1]:
16+
dp[t1][t2] = dp[t1 - 1][t2 - 1] + 1
1717
else:
18-
dp[t1 + 1][t2 + 1] = max(dp[t1][t2 + 1], dp[t1 + 1][t2])
18+
dp[t1][t2] = max(dp[t1 - 1][t2], dp[t1][t2 - 1])
19+
1920
return dp[T1][T2]
2021

22+
2123
# time complexity: O(n*m)
2224
# space compleixty: O(n*m)
2325

README.md

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -115,43 +115,3 @@ It helps others discover the repo and keeps the project growing.
115115
---
116116

117117
Feedback / Questions → open an Issue or reach out on [LinkedIn](https://www.linkedin.com/in/hogan-l/)
118-
119-
<!---LeetCode Topics Start-->
120-
# LeetCode Topics
121-
## Array
122-
| |
123-
| ------- |
124-
| [0327-count-of-range-sum](https://github.com/hogan-tech/leetcode-solution/tree/master/0327-count-of-range-sum) |
125-
## Binary Search
126-
| |
127-
| ------- |
128-
| [0327-count-of-range-sum](https://github.com/hogan-tech/leetcode-solution/tree/master/0327-count-of-range-sum) |
129-
## Divide and Conquer
130-
| |
131-
| ------- |
132-
| [0327-count-of-range-sum](https://github.com/hogan-tech/leetcode-solution/tree/master/0327-count-of-range-sum) |
133-
## Binary Indexed Tree
134-
| |
135-
| ------- |
136-
| [0327-count-of-range-sum](https://github.com/hogan-tech/leetcode-solution/tree/master/0327-count-of-range-sum) |
137-
## Segment Tree
138-
| |
139-
| ------- |
140-
| [0327-count-of-range-sum](https://github.com/hogan-tech/leetcode-solution/tree/master/0327-count-of-range-sum) |
141-
## Merge Sort
142-
| |
143-
| ------- |
144-
| [0327-count-of-range-sum](https://github.com/hogan-tech/leetcode-solution/tree/master/0327-count-of-range-sum) |
145-
## Ordered Set
146-
| |
147-
| ------- |
148-
| [0327-count-of-range-sum](https://github.com/hogan-tech/leetcode-solution/tree/master/0327-count-of-range-sum) |
149-
## String
150-
| |
151-
| ------- |
152-
| [1250-longest-common-subsequence](https://github.com/hogan-tech/leetcode-solution/tree/master/1250-longest-common-subsequence) |
153-
## Dynamic Programming
154-
| |
155-
| ------- |
156-
| [1250-longest-common-subsequence](https://github.com/hogan-tech/leetcode-solution/tree/master/1250-longest-common-subsequence) |
157-
<!---LeetCode Topics End-->

0 commit comments

Comments
 (0)