1 class Solution: 2 def isSubsequence(self, s: str, t: str) -> bool: 3 lens,lent = len(s),len(t) 4 i = j = 0 5 while i < lens and j < lent: 6 if s[i] == t[j]: 7 i += 1 8 j += 1 9 return i == lens
2023-10-11 21:58:04
1 class Solution: 2 def isSubsequence(self, s: str, t: str) -> bool: 3 lens,lent = len(s),len(t) 4 i = j = 0 5 while i < lens and j < lent: 6 if s[i] == t[j]: 7 i += 1 8 j += 1 9 return i == lens