题解 | 字符串字符匹配
字符串字符匹配
https://www.nowcoder.com/practice/22fdeb9610ef426f9505e3ab60164c93
a=input() b=input() for i in range(len(a)): if a[i] not in b: print("false") break else: if i==len(a)-1 and a[len(a)-1] in b: print("true")
遍历a字符串中每个字符,当发现不存在于b中的字符时,输出false。否则一直遍历直到最后一个元素还在b中则输出true