Python 判断子序列

s = "abc"
t = "ahbgdc"

class Solution:
    def isSubsequence(self, s: str, t: str):
        for i in range(len(s)):
            if  s[i] in t:
                if i <= t.index(s[i]) :
                   return  s;
                else:
                    return false

相关推荐