We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Re.start() & Re.end()
Re.start() & Re.end()
Sort by
recency
|
331 Discussions
|
Please Login in order to post a comment
` import re
s = input().strip() k = input().strip()
found = False
for match in re.finditer(r'(?=('+re.escape(k)+'))', s): found = True start_index = match.start(1) end_index = match.end(1) - 1 print((start_index, end_index))
if not found: print((-1, -1))
if not found: print((-1, -1))