Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def isSubsequence(self, s: str, t: str) -> bool:
- left, right = 0, 0
- while(left < len(s) and right <len(t)):
- if s[left] == t[right]:
- left += 1
- right += 1
- elif s[left] != t[right]:
- right += 1
- if left == len(s):
- return True
- return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement