简单易懂题解 | #字符串字符匹配#

字符串字符匹配

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

while True:
    try:
        s, l = input(), input()
        res = 'true'
        for i in s:
            if i not in l:
                res = 'false'
                break
        print(res)
    except:
        break
        
# while True:
#     try:
#         S, T = input(), input()
#         if set(S) & set(T) == set(S):   # set()去重,然后求交集
#             print('true')
#         else:
#             print('false')
#     except:
#         break

全部评论

相关推荐

12-19 22:04
武汉大学 Java
点赞 评论 收藏
分享
饿魔:看到在线简历了吧
点赞 评论 收藏
分享
评论
2
收藏
分享

创作者周榜

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