Python 判断子序列

时间:2020-07-28 10:16:14   收藏:0   阅读:90
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
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!