Skip to content

Commit b55ccdd

Browse files
authored
Merge pull request neetcode-gh#1247 from zliwow/patch-2
Create 392-Is Subsequence.py
2 parents 6efd670 + f8b7203 commit b55ccdd

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 True if i == len(s) else False

0 commit comments

Comments
 (0)