You are viewing a single comment's thread. Return to all comments →
My solution:
import re string = input() sample = input() matches = list(re.finditer(rf"(?={sample})", string)) if (matches == []): print((-1, -1)) for word in matches: print(tuple((word.start(), word.start() + len(sample) - 1 )))
Seems like cookies are disabled on this browser, please enable them to open this website
Re.start() & Re.end()
You are viewing a single comment's thread. Return to all comments →
My solution: