Skip to content

Commit 75cf544

Browse files
committed
Create: 392-is-subsequence.py
1 parent ff19b2a commit 75cf544

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

python/392-is-subsequence.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution:
2+
def isSubsequence(self, s: str, t: str) -> bool:
3+
i, j = 0, 0
4+
while i < len(s) and j < len(t):
5+
if s[i] == t[j]:
6+
i += 1
7+
j += 1
8+
return i == len(s)

0 commit comments

Comments
 (0)