# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param s string字符串 # @param t string字符串 # @return bool布尔型 # class Solution: def isSubsequence(self , s: str, t: str) -> bool: # write code here # 先排除任一字符串为空的情况 if s == '' or t == '': return False # 遍历t,并与s中的字符逐一比对 k = 0 for c in t: if c == s[k]: k += 1 if k == len(s): return True return False