题解 | #重复出现的字符串#
重复出现的字符串
https://www.nowcoder.com/practice/74a1dcc46607402780b6f6fc30241b2d
target = input()
patten = input()
s = target.count(patten)
print(s)
try:
m = target.index(patten)
except ValueError:
print('-1')
else:
print(m)
重复出现的字符串
https://www.nowcoder.com/practice/74a1dcc46607402780b6f6fc30241b2d
target = input()
patten = input()
s = target.count(patten)
print(s)
try:
m = target.index(patten)
except ValueError:
print('-1')
else:
print(m)
相关推荐
查看19道真题和解析