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
|
338 Discussions
|
Please Login in order to post a comment
Different approach :
import re
s = input() k = input() pattern = rf"(?=({re.escape(k)}))" if matches := list(re.finditer(pattern, s)):
else: print((-1, -1))
Here's my code:
without using regex