Skip to content

Commit 502ead0

Browse files
committed
is-subsequence.py commit
1 parent 53e4213 commit 502ead0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

two_pointer/392_is_subsequence.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class Solution(object):
2+
def isSubsequence(self, s, t):
3+
"""
4+
:type s: str
5+
:type t: str
6+
:rtype: bool
7+
"""
8+
9+
i = 0
10+
j = 0
11+
12+
while i < len(s) and j < len(t):
13+
if s[i] == t[j]:
14+
i += 1
15+
j += 1
16+
17+
return i == len(s)

0 commit comments

Comments
 (0)