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

字符串字符匹配

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

while True:
    try:
        n = str(input())
        m = str(input())
        lst = []
        for i in n:
            if i not in m:
                lst.append(i)

        if len(lst) == 0:
            print('true')
        else:
            print('false')
    except:
        break


# 评论里用set, 牛( ఠൠఠ )ノ
while True:
    try:
        S, T = input(), input()
        if set(S) & set(T) == set(S):
            print('true')
        else:
            print('false')
    except:
        break

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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