11 lines
320 B
Python
11 lines
320 B
Python
# https://leetcode.com/problems/is-subsequence
|
|
class Solution:
|
|
def isSubsequence(self, s: str, t: str) -> bool:
|
|
length = len(s)
|
|
index = 0
|
|
for c in t:
|
|
if index >= length:
|
|
break
|
|
if s[index] == c:
|
|
index += 1
|
|
return index >= length
|