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
|
355 Discussions
|
Please Login in order to post a comment
import re S = input() k = input()
find_match = list(re.finditer(rf"(?=({k}))", S))
if find_match: for i in find_match: print ((i.start(1), i.end(1)-1))
else: print((-1, -1))
result
My solution: