Skip to content

Commit 718c8a1

Browse files
authored
Update distinct_subsequences.py
1 parent e307ae5 commit 718c8a1

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

distinct_subsequences.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# coding: utf-8
2+
13
class Solution:
24
# @param S, T: Two string.
35
# @return: Count the number of distinct subsequences
@@ -24,4 +26,6 @@ def numDistinct(self, S, T):
2426
caches[i][j] = caches[i][j - 1]
2527
if T[i - 1] == S[j - 1]:
2628
caches[i][j] += caches[i - 1][j - 1]
27-
return caches[-1][-1]
29+
return caches[-1][-1]
30+
31+
# medium: http://lintcode.com/zh-cn/problem/distinct-subsequences/

0 commit comments

Comments
 (0)