Skip to content

Commit 2f7edea

Browse files
committed
Time: 33 ms (76.73%), Space: 16.6 MB (21.52%) - LeetHub
1 parent a3d46ce commit 2f7edea

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
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)