标签:lang 序列 iss == load def code pytho seq
class Solution(object):
def isSubsequence(self, s, t):
"""
:type s: str
:type t: str
:rtype: bool
"""
if len(s) > len(t):
return False
elif len(s) == len(t):
if s != t:
return False
for ch in s:
if ch not in t:
return False
if ch in t:
t = t[t.index(ch)+1:]
return True
标签:lang 序列 iss == load def code pytho seq
原文地址:https://www.cnblogs.com/panweiwei/p/13065242.html