题解 | #字符串字符匹配#
字符串字符匹配
https://www.nowcoder.com/practice/22fdeb9610ef426f9505e3ab60164c93
while True:
try:
l = []
s = input()
T = input()
for i in s: #遍历s中字符
for x in T: #遍历T中字符
if x == i: #如果s中的字符在T中也有则添加到l
l.append(i)
s1 = set(''.join(l)) #删除重复元素并变为set
s2 = set(s) #将s也变为set
if s2 == s1: #如果两set相等则为true
print('true')
else:
print('false')
except:
break


字节跳动公司福利 1301人发布