Skip to content

Commit dda0848

Browse files
authored
Update LongestRepeatedSubsequenceProblem.java
1 parent 9ee1489 commit dda0848

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

DynamicProgramming/LongestRepeatedSubsequenceProblem.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
The Recurrence is almost the same as LCS -
77
LRS[i][j] = 0 if i = 0 || j = 0
8-
= LRS[i-1][j-1] if (i != j) && s[i] == s[j]
8+
= LRS[i-1][j-1] + 1 if (i != j) && s[i] == s[j]
99
= max(LRS[i-1][j], LRS[i][j-1]) if s[i] != s[j]
1010
i and j can not have the same index as they represent the indixes of the same string.
1111

0 commit comments

Comments
 (0)