题解 | #重复出现的字符串#
重复出现的字符串
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)
相关推荐
福狼🐺:一定要学AI,现在绝大部分公司都转型ai为主懂编程的人为辅了。以后比的是谁的工作流、代码理解、架构理解、业务理解厉害了