题解 | #字符串字符匹配#

字符串字符匹配

http://www.nowcoder.com/practice/22fdeb9610ef426f9505e3ab60164c93

while True:
    try:
        s1,s2 = input(), input()
        if len(s1) <= len(s2):
            k1 = 0
            for i in s1:
                if i in s2:
                    k1 += 1
            if k1 == len(s1):
                print('true')
            else:
                print('false')
        else:
            k2 = 0
            for i in s2:
                if i in s1:
                    k2 += 1
            if k2 == len(s2):
                print('true')
            else:
                print('false')
    except:
        break
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务